Update addons/frag/functions/fnc_dev_addRound.sqf

If the round isn't in the hashmap anymore, we have to stop the PFH.
Brought code up to same standard as used in FUNC(dev_trackObj). - johnb432

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
lambdatiger 2024-02-14 17:56:05 -06:00 committed by GitHub
parent fa241cacb5
commit 61029ba723
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {};