diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 95f8f851d8..f3d79996db 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -56,8 +56,18 @@ if (_damageReturn < 0.01) exitWith {0}; if (GVAR(level) >= 1) then { _damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_medium); if (GVAR(level) >= 2) then { - _damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced); - }; + _damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced); + }; +}; + +if (_unit getVariable [QGVAR(preventDeath), false] and + {_damageReturn >= 0.9} and + {_selection in ["", "head", "body"]}) exitWith { + if (vehicle _unit != _unit and {damage _vehicle >= 1}) then { + // @todo + // [_unit] call FUNC(unload); + }; + 0.89 }; _damageReturn diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index da7a3dda40..f31c9f186d 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -43,6 +43,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then { _unit setVariable [QGVAR(hitPoints), []]; _unit setVariable [QGVAR(damages), []]; _unit setVariable [QGVAR(structDamage), 0]; + _unit setVariable [QGVAR(preventDeath), false]; };