Skip to content

Commit

Permalink
Add support to toggle allowDamage (#6266)
Browse files Browse the repository at this point in the history
  • Loading branch information
kymckay authored Jul 18, 2018
1 parent 9337949 commit 0248d5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/medical_engine/functions/fnc_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 0248d5a

Please sign in to comment.