-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix double execution of killed event #7531
Conversation
Please test with: ["CAManBase", "Init", {
params ["_unit"];
_unit addEventHandler ["Killed", {
systemChat str _this;
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler; , because: ["CAManBase", "Killed", {
systemChat str _this;
}] call CBA_fnc_addClassEventHandler; is already covered by CBATeam/CBA_A3#1291 |
Write a comment directly in the code, so it won't get cleaned up one day. |
Done. |
Seems to report correct killer, will do mp testing soon |
_unit addEventHandler ["HandleDamage", { | ||
// Not returning anything for dead units prevents double execution of Killed events. | ||
private _return = _this call FUNC(handleDamage); | ||
if (alive _unit) then {_return}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_unit
is nil
in this scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, this is what was making it "work", our EH always just returned nil; which meant the unit just died from vanilla medical.
Still getting double killed EH
|
@PabstMirror What does it report with this? |
both of these caused double killed
|
When merged this pull request will:
Don't ask why this works.