Skip to content
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

Closed
wants to merge 5 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion addons/medical_engine/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
// "exitWith", which would be broken with "HandleDamage" otherwise.
_unit setVariable [
QEGVAR(medical,HandleDamageEHID),
_unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]
_unit addEventHandler ["HandleDamage", {
// Not returning anything for dead units prevents double execution of Killed events.
private _return = _this call FUNC(handleDamage);
if (alive param [0]) then {_return};
}]
];
};
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
Expand Down