mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
70d637bcb6
commit
f7f497f0ac
@ -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";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user