Removed unneeded ground offset

This commit is contained in:
lambdatiger 2024-03-04 22:19:38 -06:00
parent 4583a0dc9c
commit deecaf9249
3 changed files with 7 additions and 13 deletions

View File

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

View File

@ -7,10 +7,9 @@
* Arguments:
* 0: Position (posASL) of fragmenting projectile <ARRAY>
* 1: Velocity of the fragmenting projectile <ARRAY>
* 2: Height (AGL) of the fragmenting projectile <NUMBER>
* 3: Type of fragments to generate <ARRAY>
* 4: Remaining fragment budget <NUMBER>
* 5: Shot parents <ARRAY>
* 2: Type of fragments to generate <ARRAY>
* 3: Remaining fragment budget <NUMBER>
* 4: Shot parents <ARRAY>
*
* 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"};

View File

@ -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