magic number clean up and white space

This commit is contained in:
lambdatiger
2024-02-14 19:57:49 -06:00
parent ae116e2577
commit a976b28c69
2 changed files with 16 additions and 8 deletions

View File

@ -18,7 +18,7 @@
*/ */
params [ params [
"_object", ["_object", objNull, [objNull]],
["_color", "blue", ["blue"]], ["_color", "blue", ["blue"]],
["_isProj", false, [false]] ["_isProj", false, [false]]
]; ];
@ -47,7 +47,7 @@ GVAR(dev_trackLines) set [getObjectID _object, [[getPosATL _object], _colorArray
if (!alive _object) exitWith { if (!alive _object) exitWith {
[_handle] call CBA_fnc_removePerFrameHandler; [_handle] call CBA_fnc_removePerFrameHandler;
}; };
private objectArray = GVAR(dev_trackLines) get (getObjectID _object); private objectArray = GVAR(dev_trackLines) get (getObjectID _object);
if (isNil "_objectArray") exitWith { if (isNil "_objectArray") exitWith {

View File

@ -21,6 +21,9 @@
* *
* Public: No * 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 [ params [
"_posASL", "_posASL",
@ -77,20 +80,25 @@ private _totalFragCount = 0;
#endif #endif
// Estimate volume and height of target // Estimate volume and height of target
private _height = 0.5; private _height = ACE_FRAG_DEFAULT_HEIGHT;
private _crossSectionArea = 1; private _crossSectionArea = ACE_FRAG_DEFAULT_CROSS_AREA;
private _isPerson = _target isKindOf "CAManBase"; private _isPerson = _target isKindOf "CAManBase";
if (_isPerson) then { if (_isPerson) then {
switch (stance _target) do { switch (stance _target) do {
case "STAND": {_height = 1.9; _crossSectionArea = 1.5;}; case "STAND": {
case "CROUCH": {_height = 1.2; _crossSectionArea = 1;}; _height = 1.9;
default {_crossSectionArea = 0.75;}; _crossSectionArea = 1.5;
};
case "CROUCH": {
_height = 1.2;
_crossSectionArea = 1;
};
}; };
} else { } else {
private _boxParams = boundingBoxReal [_target, "FireGeometry"]; private _boxParams = boundingBoxReal [_target, "FireGeometry"];
_boxParams params ["_pointA", "_pointB"]; _boxParams params ["_pointA", "_pointB"];
private _dims = _pointB vectorDiff _pointA; 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; continue;
}; };
_crossSectionArea = _dims#1 * _dims#2; _crossSectionArea = _dims#1 * _dims#2;