diff --git a/addons/frag/functions/fnc_dev_addRound.sqf b/addons/frag/functions/fnc_dev_addRound.sqf index 498f6ffad5..a1cc372bb7 100644 --- a/addons/frag/functions/fnc_dev_addRound.sqf +++ b/addons/frag/functions/fnc_dev_addRound.sqf @@ -37,17 +37,22 @@ if (_isSidePlayer) then { [ { if (isGamePaused) exitWith {}; - params ["_params", "_handle"]; - _params params ["_projectile"]; + params ["_projectile", "_handle"]; + if (!alive _projectile) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; }; - private _projectileArray = GVAR(dev_trackLines) getOrDefault [getObjectID _projectile, -1]; - if (_projectileArray isEqualType 0) exitWith {}; + + private _projectileArray = GVAR(dev_trackLines) get (getObjectID _projectile); + + if (isNil "_projectileArray") exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + }; + (_projectileArray#0) pushBack getPosATL _projectile; }, 0, - [_projectile] + _projectile ] call CBA_fnc_addPerFrameHandler; if (!_addProjectileEventHandlers) exitWith {};