Skip to content

Commit

Permalink
fix infinite detection loop
Browse files Browse the repository at this point in the history
  • Loading branch information
SnarkIndustries committed Jan 2, 2015
1 parent a0397da commit 14bf669
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DZAI/compile/heli_detectplayers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ uiSleep 2;

if (_unitGroup getVariable ["HeliDetectReady",true]) then {
_unitGroup setVariable ["HeliDetectReady",false];
_detectStartPos = getPosASL _helicopter;
while {!(_helicopter getVariable ["heli_disabled",false])} do {
private ["_detected","_detectOrigin","_detectedCount","_startPos"];
_startPos = getPosASL _helicopter;
Expand All @@ -30,7 +31,7 @@ if (_unitGroup getVariable ["HeliDetectReady",true]) then {
uiSleep 0.1;
} forEach _detected;

if (((_helicopter distance _startPos) > 500) or {_helicopter getVariable ["heli_disabled",false]}) exitWith {_unitGroup setVariable ["HeliDetectReady",true]};
if (((_helicopter distance _detectStartPos) > 700) or {_helicopter getVariable ["heli_disabled",false]}) exitWith {_unitGroup setVariable ["HeliDetectReady",true]};
uiSleep 15;
} else {
uiSleep 7.5;
Expand Down

0 comments on commit 14bf669

Please sign in to comment.