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

Common - Improve weapon unloading #9344

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

johnb432
Copy link
Contributor

When merged this pull request will:

  • Previously, if you start unloading a weapon and switch to another, it will duplicate the magazine of the newly selected weapon. This is fixed with this PR.
  • The unload action can be spammed, making it play the reload sounds as many times as the action was spammed.
  • Previously, you could press the unload keybind in turrets. It would play the sound, but do nothing. This PR makes it so that you need to be able to use the weapon in order to unload it.
  • Because of the fixes above, ace_common_fnc_unloadUnitWeapon now can take an additional argument: _magazine.
  • Additionally, for the reloading sounds it also looks for files with the .ogg extension.

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}.

@LinkIsGrim LinkIsGrim added the kind/enhancement Release Notes: **IMPROVED:** label Aug 26, 2023
@LinkIsGrim LinkIsGrim added this to the 3.16.0 milestone Aug 26, 2023
@LinkIsGrim LinkIsGrim merged commit 0bee761 into acemod:master Aug 26, 2023
private _currentWeapon = currentWeapon ACE_player;
if !(_currentWeapon != primaryWeapon _unit && {_currentWeapon != handgunWeapon _unit} && {_currentWeapon != secondaryWeapon _unit}) exitWith {false};
// Conditions
if !([_unit, objNull, ["isNotInside"]] call FUNC(canInteractWith)) exitWith {false};
Copy link
Contributor

@Drofseh Drofseh Aug 26, 2023

Choose a reason for hiding this comment

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

Does this prevent passengers/FFV from unloading their primary/secondary/handgun weapons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this prevent passengers/FFV from unloading their primary/secondary/handgun weapons?

I tested with the RHS BMP-1 and RHS M1232: You can unload in FFV positions, but not when inside as a passenger.
You can't reload your weapon using the reload keybind or action menu, so why should you be able to unload using a keybind? That's my train of thought.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, as long as FFV is supported that's fine

@johnb432 johnb432 deleted the unload-magazine-fix branch January 14, 2024 22:27
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.

3 participants