From 6fffe52947b2bae8109e35a03319e19f68a25b95 Mon Sep 17 00:00:00 2001 From: JohnM <234386938+treuenten@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:43:20 +0800 Subject: [PATCH] Let bullets set cars on fire A bullet that hit a script model raised "damage" with the hit bone as the tagName argument and an empty partName. The destructible script reads a non-empty tagName as the tag of an attached model and matches it against its part list. The body bone of a destructible car (the Suburban on Estate) matches no part, so the damage was dropped and bullets never set a car on fire. Windows, wheels and lights still broke, because their bones are part tags either way, and explosions, which carry no bone, worked. The bone now goes in partName with an empty tagName, as the vehicle damage notify already does. Co-Authored-By: Claude Opus 5.5 --- crates/sim/src/script/host/entity_damage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sim/src/script/host/entity_damage.rs b/crates/sim/src/script/host/entity_damage.rs index 0325695..e96be32 100644 --- a/crates/sim/src/script/host/entity_damage.rs +++ b/crates/sim/src/script/host/entity_damage.rs @@ -229,7 +229,7 @@ pub(crate) fn damage_entity(world: &mut World, hit: &EntityHit) -> bool { return false; }; let frame = FrameWorld::from_world(world); - let tag = hit + let part = hit .bone .and_then(|bone| { frame @@ -248,7 +248,7 @@ pub(crate) fn damage_entity(world: &mut World, hit: &EntityHit) -> bool { if world.resource::().entities[&object].kind == super::entities::EntityKind::Vehicle { - super::vehicles::damage(world, object, hit, attacker, &weapon, &tag); + super::vehicles::damage(world, object, hit, attacker, &weapon, &part); return true; } let mut runtime = world.resource_mut::(); @@ -276,8 +276,8 @@ pub(crate) fn damage_entity(world: &mut World, hit: &EntityHit) -> bool { Value::Vector(hit.point), Value::string(hit.means), Value::String(model), - Value::String(tag.as_str().into()), Value::string(""), + Value::String(part.as_str().into()), Value::Int(hit.flags), Value::String(weapon.into()), ],