From 2f1b1e30ee90a3f1bc054035a932fa49fb5f4c25 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 14 Apr 2018 10:51:51 +0100 Subject: [PATCH] Add support to toggle allowDamage --- 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 1e00d07fdf0..74773ad5603 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];