From a976b28c69bec2fea4f2de01027d4868a5a0cc6d Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 14 Feb 2024 19:57:49 -0600 Subject: [PATCH] magic number clean up and white space --- addons/frag/functions/fnc_dev_trackObj.sqf | 4 ++-- addons/frag/functions/fnc_doFragTargeted.sqf | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/addons/frag/functions/fnc_dev_trackObj.sqf b/addons/frag/functions/fnc_dev_trackObj.sqf index d3cbf03c57..dc695fbfea 100644 --- a/addons/frag/functions/fnc_dev_trackObj.sqf +++ b/addons/frag/functions/fnc_dev_trackObj.sqf @@ -18,7 +18,7 @@ */ params [ - "_object", + ["_object", objNull, [objNull]], ["_color", "blue", ["blue"]], ["_isProj", false, [false]] ]; @@ -47,7 +47,7 @@ GVAR(dev_trackLines) set [getObjectID _object, [[getPosATL _object], _colorArray if (!alive _object) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; }; - + private objectArray = GVAR(dev_trackLines) get (getObjectID _object); if (isNil "_objectArray") exitWith { diff --git a/addons/frag/functions/fnc_doFragTargeted.sqf b/addons/frag/functions/fnc_doFragTargeted.sqf index 5c96df5692..f914b64491 100644 --- a/addons/frag/functions/fnc_doFragTargeted.sqf +++ b/addons/frag/functions/fnc_doFragTargeted.sqf @@ -21,6 +21,9 @@ * * Public: No */ +#define ACE_FRAG_DEFAULT_HEIGHT 0.5 +#define ACE_FRAG_DEFAULT_CROSS_AREA 0.75 +#define ACE_FRAG_MIN_TARGET_AREA 0.5 params [ "_posASL", @@ -77,20 +80,25 @@ private _totalFragCount = 0; #endif // Estimate volume and height of target - private _height = 0.5; - private _crossSectionArea = 1; + private _height = ACE_FRAG_DEFAULT_HEIGHT; + private _crossSectionArea = ACE_FRAG_DEFAULT_CROSS_AREA; private _isPerson = _target isKindOf "CAManBase"; if (_isPerson) then { switch (stance _target) do { - case "STAND": {_height = 1.9; _crossSectionArea = 1.5;}; - case "CROUCH": {_height = 1.2; _crossSectionArea = 1;}; - default {_crossSectionArea = 0.75;}; + case "STAND": { + _height = 1.9; + _crossSectionArea = 1.5; + }; + case "CROUCH": { + _height = 1.2; + _crossSectionArea = 1; + }; }; } else { private _boxParams = boundingBoxReal [_target, "FireGeometry"]; _boxParams params ["_pointA", "_pointB"]; private _dims = _pointB vectorDiff _pointA; - if (_dims#0 * _dims#1 * _dims#2 <= 0.5) then { + if (_dims#0 * _dims#1 * _dims#2 <= ACE_FRAG_MIN_TARGET_AREA) then { continue; }; _crossSectionArea = _dims#1 * _dims#2;