From 8f70fa971aa8923ac48e533a494e2b6b9b7adc5f Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 10 Jan 2024 00:30:46 -0600 Subject: [PATCH] clarified variable names and removed submunition function call paths --- addons/frag/functions/fnc_doFrag.sqf | 23 +++++++++++------------ addons/frag/functions/fnc_fired.sqf | 2 +- addons/frag/functions/fnc_shouldFrag.sqf | 4 ++-- addons/frag/functions/fnc_submunition.sqf | 2 +- addons/frag/initSettings.inc.sqf | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index a3e77fa256..38fc261f88 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -5,11 +5,11 @@ * as handling some of the performance optimizations. * * Arguments: - * 0: Array of argumentse - * 0.0: projectile that's fragmenting - * 0.1: ASL position of projectile - * 0.2: velocity of projectile - * 1: Whether the projectile is a submunition + * 0: projectile that's fragmenting + * 1: ASL position of projectile + * 2: velocity of projectile + * 3: projectile cfgAmmo classname + * 4: getShotParents of projectile at EH * * Return Value: * None @@ -20,8 +20,8 @@ * Public: No */ TRACE_1("",_this); -params ["_args", ["_isSubMunit", false, [false]]]; -_args params [ +/*params ["_args", ["_isSubMunit", false, [false]]]; +_args*/ params [ ["_proj", objNull, [objNull]], ["_posASL", [0,0,0], [[]], [3]], ["_vel", [0,0,0] , [[]], [3]], @@ -52,14 +52,13 @@ if (_heightAGL < 0.25) then { _posASL = _posASL vectorAdd [0, 0, 0.25]; }; -// make timesince a gvar? -TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, _isSubMunit, GVAR(enSubMunit)); -if (_fragRange > 3 && _timeSince > 0.3 && {!_isSubMunit || {GVAR(enSubMunit) == 2}}) then { +// !*! make timesince a gvar? +TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, GVAR(fragSimComplexity)); +if (_fragRange > 3 && _timeSince > 0.3 && {GVAR(fragSimComplexity) == 2}) then { _maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted)); }; -// make a gvar? -if (_timeSince > 0.2 && {GVAR(enSubMunit) != 0}) then { +if (_timeSince > 0.2 && {GVAR(fragSimComplexity) != 0}) then { [_posASL, _vel, _heightAGL, _fragTypes, _maxFrags, _shotParents] call FUNC(doFragRandom); }; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 32f72b6099..5a2f0cc5c7 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -43,7 +43,7 @@ if (_doFrag) then { ]; }; -if (_doSubmunit && {GVAR(enSubMunit)> 0}) then { +if (_doSubmunit && {GVAR(fragSimComplexity)> 0}) then { _projectile addEventHandler ["SubmunitionCreated", {_this call FUNC(submunition)}]; }; diff --git a/addons/frag/functions/fnc_shouldFrag.sqf b/addons/frag/functions/fnc_shouldFrag.sqf index 587b21d4bd..35a85623f3 100644 --- a/addons/frag/functions/fnc_shouldFrag.sqf +++ b/addons/frag/functions/fnc_shouldFrag.sqf @@ -38,7 +38,7 @@ if (_skip == 1 || (_force == 0 && {_explosive < 0.5 || {_indirectHit < 3 _shouldFrag set [0, false]; }; -if (GVAR(enSubMunit) > 0) then { +/*if (GVAR(fragSimComplexity) > 1) then { private _hasSubmunit = if (isText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo")) then { "" isNotEqualTo getText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo"); } else @@ -48,7 +48,7 @@ if (GVAR(enSubMunit) > 0) then { _shouldFrag set [1, _hasSubmunit]; TRACE_2("Submunition" ,_ammo, _hasSubmunit); -}; +};*/ GVAR(shouldFragCache) set [_ammo, _shouldFrag]; diff --git a/addons/frag/functions/fnc_submunition.sqf b/addons/frag/functions/fnc_submunition.sqf index 560a706b74..613154b26c 100644 --- a/addons/frag/functions/fnc_submunition.sqf +++ b/addons/frag/functions/fnc_submunition.sqf @@ -19,7 +19,7 @@ * Public: No */ -if (!GVAR(enabled) || {GVAR(enSubMunit) == 0}) exitWith {}; +if (!GVAR(enabled) || {GVAR(fragSimComplexity) == 0}) exitWith {}; // params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"]; params ["", "_submunitionProjectile"]; diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index bb04c9df69..4e41999f5c 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -28,7 +28,7 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; /// !*! TODO: add stringtable entries [ - QGVAR(enSubMunit), "LIST", + QGVAR(fragSimComplexity), "LIST", ["Enable submunition fragmentation", "Enables submunition fragmentation when fragmentation is enabled"], [_category, LSTRING(Frag)], [[2, 1, 0], ["complex fragementation","simple fragmentation","no fragmentation"], 2]