From a1c498d33812713d32ef36d082cff9f6eb4fab8a Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 17 Jan 2024 19:40:12 -0600 Subject: [PATCH] clarified function description and removed unneeded comments --- addons/frag/functions/fnc_dev_addRound.sqf | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/frag/functions/fnc_dev_addRound.sqf b/addons/frag/functions/fnc_dev_addRound.sqf index f29f692cf4..7888b9bc80 100644 --- a/addons/frag/functions/fnc_dev_addRound.sqf +++ b/addons/frag/functions/fnc_dev_addRound.sqf @@ -1,12 +1,16 @@ #include "..\script_component.hpp" /* * Author: Lambda.Tiger - * This function adds a round to be traced. + * This function initialize projectile tracking of a round so that it's path + * can be drawn in debug mode. It may optionally include hit / explode / + * deflected event handlers that spawn color coded spheres on each event, + * green / red / blue, respectively. * * Arguments: - * 0: Projectile - * 1: Add projectile event handlers - * 2: Is the round blue + * 0: Projectile to be tracked. + * 1: Add projectile hit/explode/defelceted event handlers. + * 2: Is the round fired by a unit on the same side as the player + * true results in blue traces, false in red. * * Return Value: * None @@ -16,19 +20,19 @@ * * Public: No */ + params [ "_projectile", ["_addProjectileEventHandlers", true, [true]], ["_isSidePlayer", true, [true]] ]; -// track round on each frame -// Create entry in position array from hashmap if (_isSidePlayer) then { GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [0, 0, 1, 1]]]; } else { GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [1, 0, 0, 1]]]; }; + // event handler to track round and cleanup when round is "dead" [ { @@ -48,7 +52,6 @@ if (_isSidePlayer) then { if (!_addProjectileEventHandlers) exitWith {}; -// Add hitPart eventHandler _projectile addEventHandler [ "HitPart", { @@ -61,7 +64,6 @@ _projectile addEventHandler [ } ]; -// Add explode event handler _projectile addEventHandler [ "Explode", { @@ -74,7 +76,6 @@ _projectile addEventHandler [ } ]; -// Add deflected eventHandler _projectile addEventHandler [ "Deflected", {