If setDamage 1 command is used inside a HandleDamage event handler, the Killed event may be raised twice.
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7 x64
- Operating System Version
- A3 v1.96.146114 x64
- Category
- Scripting
Steps To Reproduce
- Add this to the editor init box of some AI:
this addEventHandler ["HandleDamage", { if (param [7] isEqualTo "hitface") then { param [0] setDamage 1; } else {0}; }]; this addEventHandler ["Killed", { systemChat str ["Killed", _this]; }];
- Preview the mission and shoot them in the head.
It will print in chat:
["Killed",[B Alpha 1-2:1,B Alpha 1-2:1,<NULL-object>,true]]
["Killed",[B Alpha 1-2:1,B Alpha 1-1:1 (OGefr. commy2),B Alpha 1-1:1 (OGefr. commy2),true]]
Event Timeline
Comment Actions
You are lucky it only fires twice. Just check how many times the HandleDamage EH fires on a single bullet.