From 9beb79ef124ebfde59d59b55fcbe9a82029357a9 Mon Sep 17 00:00:00 2001 From: Madin Date: Fri, 20 Oct 2023 01:37:35 +0200 Subject: [PATCH] cleanup func --- .../staticspawn/functions/fnc_despawnLoop.sqf | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/staticspawn/functions/fnc_despawnLoop.sqf b/addons/staticspawn/functions/fnc_despawnLoop.sqf index f8fcce2..a243d9e 100644 --- a/addons/staticspawn/functions/fnc_despawnLoop.sqf +++ b/addons/staticspawn/functions/fnc_despawnLoop.sqf @@ -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; -}; \ No newline at end of file +}; + +[ + { + _this call FUNC(despawnLoop); + }, + _this, + 0.75 + random 0.5 +] call CBA_fnc_waitAndExecute; \ No newline at end of file