Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weaponselect - Fix case sensitivity when cycling throwables #10660

Merged

Conversation

mrschick
Copy link
Contributor

@mrschick mrschick commented Jan 14, 2025

When merged this pull request will:

  • Fix case issues of modded grenades not being cycled through in ACE throwable cycling (via Shift+G), by implementing a case-insensitive check.
    It was encountered with grenades from the Unsung mod, the cause was that:
    • Grenades are sorted into ace_weaponselect_GrenadesAll/Frag/NonFrag at preInit by sifting through "CfgWeapons" >> "Throw".
    • weaponselect/fnc_selectNextGrenade.sqf however intersects the GrenadesAll array with throwables player, which is generated from CfgMagazines names.
    • In the case of Unsung, some smoke grenades have case differences between CfgMagazines and CfgWeapons, like uns_m18Purple vs uns_m18purple, causing them to be excluded from the grenade list and impossible to cycle to.

@LinkIsGrim
Copy link
Contributor

LinkIsGrim commented Jan 14, 2025

Skill issue (on Unsung's side)

@LinkIsGrim LinkIsGrim added this to the 3.19.0 milestone Jan 14, 2025
@LinkIsGrim LinkIsGrim added the kind/bug-fix Release Notes: **FIXED:** label Jan 14, 2025
@johnb432
Copy link
Contributor

johnb432 commented Jan 14, 2025

Imo this isn't an optimal fix. A better fix would be to

private _magazines = (getArray (_cfgThrow >> _x >> "magazines")) apply {_x call EFUNC(common,getConfigName)};

in preInit and nothing else needs changing. Case sensitivity is only done once at mission start, instead of everytime you cycle a grenade.

Co-Authored-By: johnb432 <[email protected]>
@PabstMirror PabstMirror added the status/added-to-RC Added after RC, need to manually add to changelog label Jan 15, 2025
Co-Authored-By: johnb432 <[email protected]>
Co-Authored-By: PabstMirror <[email protected]>
@PabstMirror PabstMirror merged commit 5a77957 into acemod:master Jan 18, 2025
3 checks passed
@PabstMirror
Copy link
Contributor

I was going to suggest we move this to preStart and cache it once
but compatibleMagazines "throw"; in preStart crashes the game 🤡

@mrschick mrschick deleted the fix/case-sensitive-grenade-cycling branch January 18, 2025 09:53
@PabstMirror PabstMirror removed the status/added-to-RC Added after RC, need to manually add to changelog label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants