Don't intercept/redistribute llDamage sent from vehicle to one of its sitters (Combat2 2024-04-11.8639309472)
in progress
Thunder Rahja
Under current behavior, all damage sent to an agent sitting on an object is redirected to the object sat on and then redistributed to all sitters. This includes
llDamage
called from a vehicle targeting one of its sitters. Please allow llDamage
called from an object/vehicle to be sent directly to its sitters.Demonstration: Create two or more prims and link them together, create the following script in the root link, and then sit on and click the object:
default
{
state_entry()
{
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_SIT_TARGET, 1, <0.5,0,0.5>, ZERO_ROTATION]);
}
touch_start()
{
key root = llList2Key(llGetObjectDetails(llDetectedKey(0), [OBJECT_ROOT]), 0);
if (root = llGetKey()) // avatar is sitting on me
{
llDamage(llDetectedKey(0), 20, 4);
llSay(0, "Sent 20 damage to " + llKey2Name(llDetectedKey(0)));
}
}
on_damage(integer num_detected)
{
llSay(0, "I took damage");
}
}
Log In
Rider Linden
in progress
Thunder Rahja
In Combat2 2024-05-02.8929584012, an object that I owned and sat on did not fire its own
on_damage
when it called llDamage
on me. This issue appears to be resolved.Wulfie Reanimator
The current behavior also prevents "custom" damage behavior, for example if a vehicle wants to block all incoming damage and then individually assign damage to specific sitters. (Imagine a tank with an exposed gunner at the top. The driver should be safe while the gunner receives damage.) The vehicle would block its own damage in this case, which is no fun.