diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 6fa184888..7b1913c23 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -69,7 +69,7 @@ dayz_lastDamageSourceNull = false; if (_unit == player) then { //Set player in combat _unit setVariable["startcombattimer", 1]; - if (_unit getVariable["inCombat",false]) then { + if !(_unit getVariable["inCombat",false]) then { _unit setVariable["inCombat",true,true]; }; diff --git a/SQF/dayz_code/compile/player_weaponFiredNear.sqf b/SQF/dayz_code/compile/player_weaponFiredNear.sqf index e47c03e11..b9ad01699 100644 --- a/SQF/dayz_code/compile/player_weaponFiredNear.sqf +++ b/SQF/dayz_code/compile/player_weaponFiredNear.sqf @@ -22,12 +22,12 @@ private ["_handled"]; // Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4 //diag_log ("DEBUG: AMMO TYPE: " +str(_ammo)); _firer setVariable["startcombattimer", 1]; - if (_firer getVariable["inCombat",false]) then { + if !(_firer getVariable["inCombat",false]) then { _firer setVariable["inCombat",true,true]; }; if (_distance <= 8) then { _unit setVariable["startcombattimer", 1]; - if (_unit getVariable["inCombat",false]) then { + if !(_unit getVariable["inCombat",false]) then { _unit setVariable["inCombat",true,true]; }; }; diff --git a/SQF/dayz_code/system/BIS_Effects/fired.sqf b/SQF/dayz_code/system/BIS_Effects/fired.sqf index 0c8e0ea49..983c42774 100644 --- a/SQF/dayz_code/system/BIS_Effects/fired.sqf +++ b/SQF/dayz_code/system/BIS_Effects/fired.sqf @@ -3,7 +3,7 @@ _amm=_this select 4; _this call (call compile GetText (configFile >> "CfgAmmo" >> _amm >> "muzzleEffect")); //Handle combat in vehicle if (player in (crew (_this select 0))) then { - if (player getVariable ["inCombat",false]) then { + if !(player getVariable ["inCombat",false]) then { player setVariable ["inCombat",true,true]; }; player setVariable["combattimeout", diag_tickTime + 30, false]; diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 8d460c770..96f2df560 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -344,7 +344,7 @@ while {1 == 1} do { _startcombattimer = player getVariable["startcombattimer", 0]; if (_startcombattimer == 1) then { //Do not use _PlayerNearby it makes building impossible, this is handled in player_onPause.sqf just fine player setVariable["combattimeout", diag_tickTime + 30, false]; - if (player getVariable["inCombat",false]) then {player setVariable["inCombat",true,true];}; + if !(player getVariable["inCombat",false]) then {player setVariable["inCombat",true,true];}; player setVariable["startcombattimer", 0, false]; }; /* else { if (_ZedsNearby && !_isPZombie) then { //this makes building a nightmare, this is handled in player_onPause.sqf just fine