Medical Status - Add isDamageAllowed check to setDead (#8803)

* add delay & logs

* add remote support

* isDamageAllowed check

* add internal comment to setDead event

* remove remote setDead EH

* remove unnecessary changes

* Add comments and move check below the event
This commit is contained in:
GhostIsSpooky 2022-02-06 13:36:28 -03:00 committed by GitHub
parent 70d637bcb6
commit f7f497f0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,13 @@ _unit setVariable [QEGVAR(medical,causeOfDeath), _reason, true];
// Send a local event before death
[QEGVAR(medical,death), [_unit]] call CBA_fnc_localEvent;
// (#8803) Reenable damage if disabled to prevent having live units in dead state
// Keep this after death event for compatibility with third party hooks
if !(isDamageAllowed _unit) then {
WARNING_1("setDead executed on unit with damage blocked - %1",_this);
_unit allowDamage true;
};
// Kill the unit without changing visual apperance
private _prevDamage = _unit getHitPointDamage "HitHead";