clarified variable names and removed submunition function call paths

This commit is contained in:
lambdatiger 2024-01-10 00:30:46 -06:00
parent 1e93453963
commit 8f70fa971a
5 changed files with 16 additions and 17 deletions

View File

@ -5,11 +5,11 @@
* as handling some of the performance optimizations. * as handling some of the performance optimizations.
* *
* Arguments: * Arguments:
* 0: Array of argumentse * 0: projectile that's fragmenting <OBJECT>
* 0.0: projectile that's fragmenting <OBJECT> * 1: ASL position of projectile <ARRAY>
* 0.1: ASL position of projectile <ARRAY> * 2: velocity of projectile <ARRAY>
* 0.2: velocity of projectile <ARRAY> * 3: projectile cfgAmmo classname <STRING>
* 1: Whether the projectile is a submunition <BOOL> * 4: getShotParents of projectile at EH <ARRAY>
* *
* Return Value: * Return Value:
* None * None
@ -20,8 +20,8 @@
* Public: No * Public: No
*/ */
TRACE_1("",_this); TRACE_1("",_this);
params ["_args", ["_isSubMunit", false, [false]]]; /*params ["_args", ["_isSubMunit", false, [false]]];
_args params [ _args*/ params [
["_proj", objNull, [objNull]], ["_proj", objNull, [objNull]],
["_posASL", [0,0,0], [[]], [3]], ["_posASL", [0,0,0], [[]], [3]],
["_vel", [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]; _posASL = _posASL vectorAdd [0, 0, 0.25];
}; };
// make timesince a gvar? // !*! make timesince a gvar?
TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, _isSubMunit, GVAR(enSubMunit)); TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, GVAR(fragSimComplexity));
if (_fragRange > 3 && _timeSince > 0.3 && {!_isSubMunit || {GVAR(enSubMunit) == 2}}) then { if (_fragRange > 3 && _timeSince > 0.3 && {GVAR(fragSimComplexity) == 2}) then {
_maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted)); _maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted));
}; };
// make a gvar? if (_timeSince > 0.2 && {GVAR(fragSimComplexity) != 0}) then {
if (_timeSince > 0.2 && {GVAR(enSubMunit) != 0}) then {
[_posASL, _vel, _heightAGL, _fragTypes, _maxFrags, _shotParents] call FUNC(doFragRandom); [_posASL, _vel, _heightAGL, _fragTypes, _maxFrags, _shotParents] call FUNC(doFragRandom);
}; };

View File

@ -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)}]; _projectile addEventHandler ["SubmunitionCreated", {_this call FUNC(submunition)}];
}; };

View File

@ -38,7 +38,7 @@ if (_skip == 1 || (_force == 0 && {_explosive < 0.5 || {_indirectHit < 3
_shouldFrag set [0, false]; _shouldFrag set [0, false];
}; };
if (GVAR(enSubMunit) > 0) then { /*if (GVAR(fragSimComplexity) > 1) then {
private _hasSubmunit = if (isText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo")) then { private _hasSubmunit = if (isText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo")) then {
"" isNotEqualTo getText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo"); "" isNotEqualTo getText (configFile >> "cfgAmmo" >> _ammo >> "submunitionAmmo");
} else } else
@ -48,7 +48,7 @@ if (GVAR(enSubMunit) > 0) then {
_shouldFrag set [1, _hasSubmunit]; _shouldFrag set [1, _hasSubmunit];
TRACE_2("Submunition" ,_ammo, _hasSubmunit); TRACE_2("Submunition" ,_ammo, _hasSubmunit);
}; };*/
GVAR(shouldFragCache) set [_ammo, _shouldFrag]; GVAR(shouldFragCache) set [_ammo, _shouldFrag];

View File

@ -19,7 +19,7 @@
* Public: No * Public: No
*/ */
if (!GVAR(enabled) || {GVAR(enSubMunit) == 0}) exitWith {}; if (!GVAR(enabled) || {GVAR(fragSimComplexity) == 0}) exitWith {};
// params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"]; // params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"];
params ["", "_submunitionProjectile"]; params ["", "_submunitionProjectile"];

View File

@ -28,7 +28,7 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
/// !*! TODO: add stringtable entries /// !*! TODO: add stringtable entries
[ [
QGVAR(enSubMunit), "LIST", QGVAR(fragSimComplexity), "LIST",
["Enable submunition fragmentation", "Enables submunition fragmentation when fragmentation is enabled"], ["Enable submunition fragmentation", "Enables submunition fragmentation when fragmentation is enabled"],
[_category, LSTRING(Frag)], [_category, LSTRING(Frag)],
[[2, 1, 0], ["complex fragementation","simple fragmentation","no fragmentation"], 2] [[2, 1, 0], ["complex fragementation","simple fragmentation","no fragmentation"], 2]