Skip to content

Commit

Permalink
cleanup func
Browse files Browse the repository at this point in the history
  • Loading branch information
Madin authored and Madin committed Oct 19, 2023
1 parent b223de5 commit 9beb79e
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions addons/staticspawn/functions/fnc_despawnLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ private _spherePos = _pos getPos [_sphereSizeUnit - _sphereBackDistanceUnit + _s
private _nearplayers = _spherePos nearEntities ["allVehicles", _sphereSizeUnit + _sphereDespawnDistanceUnit];
private _playerIndex = _nearplayers findIf {isPlayer _x && !(vehicle _x isKindOf "AIR")};
// despawn unit
if (_playerIndex == -1) then {
if (_playerIndex == -1) exitWith {
[_unit, _logic, _unitArray] call FUNC(despawn);
// private _active = _logic getVariable [QGVAR(active), true];
// if !(_active) then {
// systemChat "despawnLoop line 35";
// [_logic] call MAI_fnc_staticSpawnInterval;
// };
} else {
[
{
_this call FUNC(despawnLoop);
},
_this,
0.75 + random 0.5
] call CBA_fnc_waitAndExecute;
};
};

[
{
_this call FUNC(despawnLoop);
},
_this,
0.75 + random 0.5
] call CBA_fnc_waitAndExecute;

0 comments on commit 9beb79e

Please sign in to comment.