-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
on_damage is not being passed the new DetectedEvent userdata values
I suspect this is due to this set containing "damage" instead of "on_damage"
Lines 512 to 522 in ecea738
| static const std::unordered_set<std::string> MULTI_EVENT_NAMES = { | |
| "touch_start", | |
| "touch_end", | |
| "touch", | |
| "collision_start", | |
| "collision", | |
| "collision_end", | |
| "sensor", | |
| "damage", | |
| "final_damage" | |
| }; |
Reproduction
- Create a prim
- Take a copy
- Add the copy to the prim's inventory (leave it's name as
Object) - add this script to the prim
local touchStart = function(detected)
ll.RezObjectWithParams(
"Object",
{
REZ_FLAGS, bit32.bor(REZ_FLAG_TEMP,REZ_FLAG_PHYSICAL,REZ_FLAG_DIE_ON_COLLIDE,REZ_FLAG_DIE_ON_NOENTRY),
REZ_POS, vector(0,0,2), true, true,
REZ_DAMAGE, 10,
REZ_DAMAGE_TYPE, DAMAGE_TYPE_BLUDGEONING,
}
)
end
LLEvents:on("touch_start",touchStart)
LLEvents:on("on_damage",function(a)
ll.OwnerSay(`on_damage {a} {typeof(a)}`)
end)- Click the prim
- Notice the message
on_damage 1 numberin chat
Additional
Personally I would prefer on_damage, on_rez, and on_death to drop their on_ prefix, as
LLEvents:on("damage", ...)Reads cleaner than
LLEvents:on("on_damage", ...)Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working