-
Notifications
You must be signed in to change notification settings - Fork 291
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
Fix gunmod checks #2737
Fix gunmod checks #2737
Conversation
7e8b410
to
1f59aef
Compare
1f59aef
to
43b5cf7
Compare
could you add instructions on how to test the PR? |
Related issue: #649 Testing the main issue this seeks to fix, as quoted from the bug report:
If fixed, step three will differ in there being no warning message displayed. Testing whether conversion kits still work SHOULD still be doable by spawning them in debug, as I found them still buried in json/obsoletion/items.json so search the item spawn menu for |
My concern there is mainly that since they've been obsoleted for a while they may no longer be compatible. Furthermore, I'm not even sure what magazine adaptors exist and where we would test that. |
Since it fires if the gun has no compatible magazine loaded.
dfc7eab
to
8d5a795
Compare
8d5a795
to
865c4a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that the tests work:
waterproofings were used for testing all non-conversion gunmods.
Spawn M4A1, remove magazine, install any compatible gunmod that is not a conversion kit: waterproofing, shoulderstrap, suppressor, etc. Check that no warning fires.
With magazine in, install any compatible gunmod, check that no warning fires.
Via Json, add Bore mod location to Remington 1100
Spawn Remington 1100 shotgun, install any compatible gunmod that is not a conversion kit. Check that no warning fires
Spawn 7.62x51mm caliber conversion kit, install into M4A1 and Remington, check that warning only fires for M4A1.
Spawn .300 AAC Blackout AR-15 conversion kit. Install into M4A1, check that no warning fires.
tracked in #2817
Testing conversion kit with shotguns
while the gunmods installation works, there's still 00 shot left after installing conversion kit to remington 1100. but i guess it's okay as the game does not let you shoot while incompatible ammos are loaded
LGTM
Summary
SUMMARY: Bugfixes "Fix gunmod installation checks for integral magazines."
Purpose of change
When gunmods are installed, warning for magazine adaptor appears in inappropriate situations. As the check does nothing within the same universe as what the warning is meant to indicate. It checks whether the gun's loaded magazine has a default ammo type. Meaning that if you could install a conversion kit while the gun was loaded (which is impossible), the check would pass.
Furthermore, it fails due to guns with integral magazines not returning a default ammo type, as they count as "not loaded" with a magazine. It also fails when unloaded guns are modified, even when the modification doesn't change the ammo type used by the gun.
Describe the solution
Rewrite the entire check so it provides appropriate warning.
Describe alternatives you've considered
Testing
Additional context