Skip to content

Commit

Permalink
Weaponselect - Fix case sensitivity when cycling throwables (#10660)
Browse files Browse the repository at this point in the history
* Case-insensitive check for valid throwables

* Optimized suggestion

Co-Authored-By: johnb432 <[email protected]>

* Faster rework

Co-Authored-By: johnb432 <[email protected]>
Co-Authored-By: PabstMirror <[email protected]>

---------

Co-authored-by: johnb432 <[email protected]>
Co-authored-by: PabstMirror <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2025
1 parent 1f4aabe commit 5a77957
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions addons/weaponselect/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ private _cfgMagazines = configFile >> "CfgMagazines";
private _cfgAmmo = configFile >> "CfgAmmo";
private _cfgThrow = configFile >> "CfgWeapons" >> "Throw";

{
private _magazines = getArray (_cfgThrow >> _x >> "magazines");
GVAR(GrenadesAll) = compatibleMagazines "throw";

GVAR(GrenadesAll) append _magazines;

{
private _ammo = getText (_cfgMagazines >> _x >> "ammo");
private _explosive = getNumber (_cfgAmmo >> _ammo >> "explosive");

([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x;
} forEach _magazines;
} forEach getArray (_cfgThrow >> "muzzles");
GVAR(GrenadesNonFrag) = GVAR(GrenadesAll) select {getNumber (_cfgAmmo >> getText (_cfgMagazines >> _x >> "ammo") >> "explosive") == 0};
GVAR(GrenadesFrag) = GVAR(GrenadesAll) - GVAR(GrenadesNonFrag);

#include "initSettings.inc.sqf"

Expand Down

0 comments on commit 5a77957

Please sign in to comment.