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

Arsenal - Improve magazine removal after weapon switch #8786

Merged
merged 1 commit into from
Mar 7, 2022
Merged

Arsenal - Improve magazine removal after weapon switch #8786

merged 1 commit into from
Mar 7, 2022

Conversation

johnb432
Copy link
Contributor

When merged this pull request will:
Improve the removal of magazines when switching weapons in the arsenal.

Current behaviour:

  • When a new weapon is selected, only magazines defined in the "magazines" attribute of the old weapon's class were deleted.
    See here.
    This leads to inconsistent and unnecessary magazine removal upon weapon switching.
  • When a new weapon is selected, it would consume a magazine from the loadout.
    See here.

Improved behaviour:

  • When a new weapon is selected, it will remove all magazines from the previous weapon that are not compatible with the new weapon.
    See here.
    This is also valid when selecting no weapon: It will remove all magazines of the previous weapon.

On a personal note, I think the above can be seen as good and bad behaviour: When selecting launcher ammunition when you have a launcher equipped means that when you unequip the launcher in the arsenal, it will delete the launcher magazines.
However for other weapon types, especially side arms in my opinion, it can be very handy to remove all of the side arm magazines along with the unequipped weapon.
This behaviour can be circumvented by selecting the desired magazines via the all magazines tab in the arsenal, but it might pose an inconvenience for some.
Either way, I'm open for discussion - a CBA setting could be added if needed.

  • When a new weapon is selected, it does not consume a magazine from the loadout.
    See here.

What hasn't changed is if you have magazines from a weapon that isn't involved in switching process, it still won't affect those magazines.
E.g: If you have an RPG-7 and you switch your primary weapon (e.g. basegame HK416), it will not remove the RPG-7 rounds you have in your loadout.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

Previously:
- When a new weapon was selected, only magazines defined in the "magazines" attribute of the old weapon's class were deleted.
- When a new weapon was selected, it would consume a magazine from the loadout.

Now:
- When a new weapon is selected, it will only remove the magazines from the previous weapon that are not compatible with the current weapon.
- When a new weapon is selected, it does not consume a magazine from the loadout.
@mharis001 mharis001 added the kind/enhancement Release Notes: **IMPROVED:** label Jan 22, 2022
@@ -29,10 +29,15 @@ private _containerDefaultRightPanel = _display displayCtrl IDC_buttonMisc;
private _selectCorrectPanelContainer = [_containerDefaultRightPanel, _display displayCtrl GVAR(currentRightPanel)] select (!isNil QGVAR(currentRightPanel) && {GVAR(currentRightPanel) in [RIGHT_PANEL_ITEMS_IDCS]});

private _fnc_clearPreviousWepMags = {
private _compatibleMags = getArray (configfile >> "cfgweapons" >> _baseWeapon >> "magazines");
private _compatibleMagsBaseWeapon = [_baseWeapon, true] call CBA_fnc_compatibleMagazines;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also gets mags from other muzzles (e.g. grenade launcher), which I think is what we want

@PabstMirror PabstMirror added this to the 3.14.2 milestone Mar 7, 2022
@PabstMirror PabstMirror merged commit 90ebe08 into acemod:master Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants