Add support to toggle allowDamage (#6266)

This commit is contained in:
SilentSpike 2018-07-18 19:31:29 +01:00 committed by GitHub
parent 3bbc1d21e4
commit 0e50aca9d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];