mirror of
https://github.com/vladtrc/iw4L
synced 2026-10-26 02:11:39 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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::<RoundScript>().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::<RoundScript>();
|
||||
@@ -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()),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user