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

CSW - Remove 'Disabled' option from Ammo Handling #9322

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

LinkIsGrim
Copy link
Contributor

@LinkIsGrim LinkIsGrim commented Aug 12, 2023

When merged this pull request will:

  • Title.

Ammo Handling for players is now available solely based on the weapon's assembly mode:

  • Static Weapons with assemblyMode set to anything other than 0 will have ammo handling enabled.
  • Static Weapons with assemblyMode set to 0 will not use any of CSW's systems.

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
Copy link
Contributor Author

Implemented #9322 (comment)

@PabstMirror
Copy link
Contributor

I think we just need to add a new setVar for disabling ammo handling
I don't like it being linked to assembly mode
The 2 features should be completely unlinked

I don't like how the mk6 setting could disable assembly
https://github.com/acemod/ACE3/pull/9238/files#diff-c9d9cdbb4787a8728a6565135fa1a3506a8e6f82149c0a74858e513f3ed114fbR15-R16

the logic before was

  • enable if the ammoHandling setting was enabled
  • or if adv assembly, then force it on

if we're getting rid of the disabled setting, then it should just always be on

Comment on lines +24 to +25
// Skip if CSW is explicitly disabled (assemblyMode = 0)
if ((_vehicle getVariable [QGVAR(assemblyMode), 3]) == 0) exitWith {_return};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Skip if CSW is explicitly disabled (assemblyMode = 0)
if ((_vehicle getVariable [QGVAR(assemblyMode), 3]) == 0) exitWith {_return};
// Skip if CSW reload is explicitly disabled
if (_vehicle getVariable [QGVAR(reloadDisabled), false]) exitWith {_return};

if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false };
[_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith)
// If CSW isn't disabled for this static we enable ammo handling
((_target getVariable [QGVAR(assemblyMode), 3]) != 0) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
((_target getVariable [QGVAR(assemblyMode), 3]) != 0) &&
(!(_target getVariable [QGVAR(reloadDisabled), false])) &&

@@ -88,7 +88,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then {
_ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass);
};

if (["ACE_reload"] call EFUNC(common,isModLoaded)) then {
if (["ACE_reload"] call EFUNC(common,isModLoaded) && {(_target getVariable [QGVAR(assemblyMode), 3]) != 0}) then {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (["ACE_reload"] call EFUNC(common,isModLoaded) && {(_target getVariable [QGVAR(assemblyMode), 3]) != 0}) then {
if (["ACE_reload"] call EFUNC(common,isModLoaded) && {!(_target getVariable [QGVAR(reloadDisabled), false])}) then {

@LinkIsGrim
Copy link
Contributor Author

I like the idea of ammo handling being completely separate from assemblyMode. I originally wanted to do that just that.

I have another idea in mind but I'll make a spin-off to the CSW PR saga as code is easier to read.

@johnb432
Copy link
Contributor

johnb432 commented Dec 27, 2023

I like the idea of ammo handling being completely separate from assemblyMode. I originally wanted to do that just that.

I have another idea in mind but I'll make a spin-off to the CSW PR saga as code is easier to read.

Currently testing 9234. To me, it doesn't make sense to keep assemblyMode and ammoHandling combined, they should be fully separated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants