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

Safemode - Refactor #10111

Merged
merged 11 commits into from
Aug 2, 2024
Merged

Safemode - Refactor #10111

merged 11 commits into from
Aug 2, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Jul 8, 2024

When merged this pull request will:

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

@johnb432 johnb432 added the kind/bug-fix Release Notes: **FIXED:** label Jul 8, 2024
@johnb432 johnb432 added this to the 3.18.0 milestone Jul 8, 2024
@johnb432
Copy link
Contributor Author

johnb432 commented Jul 17, 2024

Do we want weapon safety to remain on a specific weapon and muzzle basis or should we change it so that it's like persistent lights/lasers, where only the weapon type (primary, handgun, secondary) matters?

The current code of both master and this PR don't work with the RHS grip system (I imagine the tactical reloading of NIArms, as well its grip system, and 3CB BAF's grip system don't work either). If we switched to a weapon type based system, it would address that, but it means that if you have some mod that can handle multiple of the same weapon type (e.g. multiple primary weapons), it would apply the safety based on that and not the weapon/muzzle.

Thoughts?

johnb432 and others added 2 commits July 30, 2024 10:13
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@PabstMirror
Copy link
Contributor

I'm happy with the code as is

I looked at HLC and RHS, neither seem to offer a easy hook for us to use
We could offer some kind of transferSaftey func but I really don't think it will get used

params ["_unit", "_old", "_new"];
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), createHashMap];
private _safedWeaponMuzzles = _safedWeapons deleteAt _old;
if (isNil "_safedWeaponMuzzles") exitWith {};
_safedWeapons set [_new, _safedWeaponMuzzles];

@johnb432 johnb432 merged commit 6a25e93 into master Aug 2, 2024
5 checks passed
@johnb432 johnb432 deleted the safemode-refactor branch August 2, 2024 11:59
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Refactor safemode

* Further improvements and fixes

* Update XEH_postInit.sqf

* Don't allow binoculars to be set to safe

* Add API for getting weapon safety status

* Update fnc_jamWeapon.sqf

* Added doc

* Update fnc_playChangeFiremodeSound.sqf

* Update addons/overheating/functions/fnc_jamWeapon.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/weaponselect/functions/fnc_selectWeaponMode.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
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.

Safe Mode broken for sub muzzles, taking off safety puts you in the wrong weapon mode
2 participants