diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e91de4c23d3..f1c12497497 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -149,15 +149,15 @@ if (isServer) then { [QGVAR(setVanillaHitPointDamage), { params ["_object", "_hitPointAnddamage"]; - private _isDamageAllowed = isDamageAllowed _object; + private _damageDisabled = !isDamageAllowed _object; - if !(_isDamageAllowed) then { + if (_damageDisabled) then { _object allowDamage true; }; _object setHitPointDamage _hitPointAnddamage; - if !(_isDamageAllowed) then { + if (_damageDisabled) then { _object allowDamage false; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/medical_engine/functions/fnc_setStructuralDamage.sqf b/addons/medical_engine/functions/fnc_setStructuralDamage.sqf index e3117a7b6a8..5e3dcd7b05f 100644 --- a/addons/medical_engine/functions/fnc_setStructuralDamage.sqf +++ b/addons/medical_engine/functions/fnc_setStructuralDamage.sqf @@ -24,8 +24,8 @@ if (!local _unit) exitWith { private _hitPointDamages = getAllHitPointsDamage _unit param [2, []]; -private _isDamageAllowed = isDamageAllowed _unit; -if !(_isDamageAllowed) then { +private _damageDisabled = !isDamageAllowed _unit; +if (_damageDisabled) then { _unit allowDamage true; }; @@ -35,6 +35,6 @@ _unit setDamage _damage; _unit setHitIndex [_forEachIndex, _x]; } forEach _hitPointDamages; -if !(_isDamageAllowed) then { +if (_damageDisabled) then { _unit allowDamage false; }; diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 6ffbe83eb30..2cbbd8c3e1d 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -6,15 +6,15 @@ // wheels [QGVAR(setWheelHitPointDamage), { params ["_object", "_hitPoint", "_damage"]; - private _isDamageAllowed = isDamageAllowed _object; + private _damageDisabled = !isDamageAllowed _object; - if !(_isDamageAllowed) then { + if (_damageDisabled) then { _object allowDamage true; }; _object setHitPointDamage [_hitPoint, _damage]; - if !(_isDamageAllowed) then { + if (_damageDisabled) then { _object allowDamage false; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/repair/functions/fnc_setDamage.sqf b/addons/repair/functions/fnc_setDamage.sqf index d8e19212d1c..ba51c22c0df 100644 --- a/addons/repair/functions/fnc_setDamage.sqf +++ b/addons/repair/functions/fnc_setDamage.sqf @@ -26,8 +26,8 @@ if !(local _vehicle) exitWith {}; (getAllHitPointsDamage _vehicle) params [["_allHitPoints", []], ["_allHitPointsSelections", []], ["_allHitPointDamages", []]]; // set damage of the vehicle -private _isDamageAllowed = isDamageAllowed _vehicle; -if !(_isDamageAllowed) then { +private _damageDisabled = !isDamageAllowed _vehicle; +if (_damageDisabled) then { _vehicle allowDamage true; }; @@ -38,9 +38,9 @@ _vehicle setDamage _damage; _vehicle setHitIndex [_forEachIndex, _x]; } forEach _allHitPointDamages; -if !(_isDamageAllowed) then { - _vehicle allowDamage false; -}; - // normalize hitpoints [_vehicle] call FUNC(normalizeHitPoints); + +if (_damageDisabled) then { + _vehicle allowDamage false; +}; diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 72c369d5cba..0e8a8056893 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -62,8 +62,8 @@ if (_hitPointDamageSumOld > 0) then { TRACE_5("structuralDamage",_damageOld,_damageNew,_hitPointDamageRepaired,_hitPointDamageSumOld,_realHitpointCount); // set new structural damage value -private _isDamageAllowed = isDamageAllowed _vehicle; -if !(_isDamageAllowed) then { +private _damageDisabled = !isDamageAllowed _vehicle; +if (_damageDisabled) then { _vehicle allowDamage true; }; @@ -80,6 +80,6 @@ _allHitPointDamages set [_hitPointIndex, _hitPointDamage]; // normalize hitpoints [_vehicle] call FUNC(normalizeHitPoints); -if !(_isDamageAllowed) then { +if (_damageDisabled) then { _vehicle allowDamage false; };