Skip to content

Commit

Permalink
revert a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
commy2 committed May 3, 2019
1 parent ec4593b commit 2428e48
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions addons/medical_engine/functions/fnc_setStructuralDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -35,6 +35,6 @@ _unit setDamage _damage;
_unit setHitIndex [_forEachIndex, _x];
} forEach _hitPointDamages;

if !(_isDamageAllowed) then {
if (_damageDisabled) then {
_unit allowDamage false;
};
6 changes: 3 additions & 3 deletions addons/repair/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
12 changes: 6 additions & 6 deletions addons/repair/functions/fnc_setDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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;
};
6 changes: 3 additions & 3 deletions addons/repair/functions/fnc_setHitPointDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -80,6 +80,6 @@ _allHitPointDamages set [_hitPointIndex, _hitPointDamage];
// normalize hitpoints
[_vehicle] call FUNC(normalizeHitPoints);

if !(_isDamageAllowed) then {
if (_damageDisabled) then {
_vehicle allowDamage false;
};

0 comments on commit 2428e48

Please sign in to comment.