From deecaf9249003bdf784f68219877330c48c501dc Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 4 Mar 2024 22:19:38 -0600 Subject: [PATCH] Removed unneeded ground offset --- addons/frag/functions/fnc_doFrag.sqf | 7 +------ addons/frag/functions/fnc_doFragRandom.sqf | 12 ++++++------ addons/frag/script_component.hpp | 1 - 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index 0b11b809cd..c068af3494 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -44,11 +44,6 @@ if (_modFragCount < ACE_FRAG_LOW_FRAG_MOD_COUNT) then { } else { GVAR(lastFragTime) = CBA_missionTime; }; -// Offset for ground clearance -private _heightATL = (ASLToATL _posASL)#2; -if (_heightATL < ACE_FRAG_MIN_GROUND_OFFSET) then { - _posASL = _posASL vectorAdd [0, 0, ACE_FRAG_MIN_GROUND_OFFSET - (0 min _heightATL)]; -}; TRACE_3("doFrag choices",_maxFragCount,_fragRange,GVAR(fragSimComplexity)); if (GVAR(fragSimComplexity) != 1 && _fragRange > 3) then { @@ -56,5 +51,5 @@ if (GVAR(fragSimComplexity) != 1 && _fragRange > 3) then { }; if (GVAR(fragSimComplexity) > 0 && _maxFragCount >= ACE_FRAG_MIN_FRAG_BUDGET_FOR_RANDOM) then { - [_posASL, _velocity, _heightATL, _fragTypes, _maxFragCount, _shotParents] call FUNC(doFragRandom); + [_posASL, _velocity, _fragTypes, _maxFragCount, _shotParents] call FUNC(doFragRandom); }; diff --git a/addons/frag/functions/fnc_doFragRandom.sqf b/addons/frag/functions/fnc_doFragRandom.sqf index a173513521..dd3d6b0b5e 100644 --- a/addons/frag/functions/fnc_doFragRandom.sqf +++ b/addons/frag/functions/fnc_doFragRandom.sqf @@ -7,10 +7,9 @@ * Arguments: * 0: Position (posASL) of fragmenting projectile * 1: Velocity of the fragmenting projectile - * 2: Height (AGL) of the fragmenting projectile - * 3: Type of fragments to generate - * 4: Remaining fragment budget - * 5: Shot parents + * 2: Type of fragments to generate + * 3: Remaining fragment budget + * 4: Shot parents * * Return Value: * None @@ -21,10 +20,11 @@ * Public: No */ -params ["_posASL", "_fragVelocity", "_heightATL", "_fragType", "_maxFragCount", "_shotParents"]; -TRACE_6("doFragRandom",_posASL,_fragVelocity,_heightATL,_fragType,_maxFragCount,_shotParents); +params ["_posASL", "_fragVelocity", "_fragType", "_maxFragCount", "_shotParents"]; +TRACE_5("doFragRandom",_posASL,_fragVelocity,_fragType,_maxFragCount,_shotParents); // See CfgAmmoFragSpawner for different frag types +private _heightATL = (ASLToATL _posASL)#2; private _hMode = switch (true) do { case (_heightATL > 10): {"_top"}; case (_heightATL > 5): {"_hi"}; diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 0c860c76f8..f394ad35a6 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -32,7 +32,6 @@ #define ACE_FRAG_HALF_GRAVITY_APPROX 4.905 // Lowest chance to hit of 0.5% #define ACE_FRAG_MIN_FRAG_HIT_CHANCE 0.005 -#define ACE_FRAG_MIN_GROUND_OFFSET 0.25 // Make frag hold-off time shortger for low frag // value of 150/4/pi ~= 11.93662 #define ACE_FRAG_LOW_FRAG_MOD_COUNT 11.93662