From 0e50aca9d84660b36de1fd726d34a706f6c5d4be Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Wed, 18 Jul 2018 19:31:29 +0100 Subject: [PATCH] Add support to toggle allowDamage (#6266) --- addons/medical_engine/functions/fnc_handleDamage.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 3663f96bd6..b1611cebf3 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -46,6 +46,9 @@ if (_hitPointIndex < 0) then { _unit setVariable [HIT_CRASH, -1]; }; +// Damage can be disabled with old variable or via sqf command allowDamage +if !(isDamageAllowed _unit && _unit getVariable [QEGVAR(medical,allowDamage), true]) exitWith {_oldDamage}; + private _newDamage = _damage - _oldDamage; _unit setVariable [format [QGVAR($%1), _hitPoint], _newDamage];