-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 furniture reloading with multiple ammo types #72743
Conversation
Alternative to #72703 I guess? |
Yeah whoops, didn’t see Kate post that while I was working on this.
j
…On Sat, Mar 30, 2024 at 22:23 RenechCDDA ***@***.***> wrote:
Alternative to #72703
<#72703> I guess?
—
Reply to this email directly, view it on GitHub
<#72743 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKGAAAYRXE745DLFN6RT3Y26MULAVCNFSM6AAAAABFQD2LFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGU3DAMBQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Looks like there's more here than what is in my branch, if @RenechCDDA wants to add their changes to this and merge this instead I'm fine with it |
We might want to blend them a bit? Idk if it’s better to restrict to one
ammo like this does or allow mixing like yours does
j
…On Sun, Mar 31, 2024 at 09:00 Kate ***@***.***> wrote:
Looks like there's more here than what is in my branch, if @RenechCDDA
<https://github.com/RenechCDDA> wants to add their changes to this and
merge this instead I'm fine with it
—
Reply to this email directly, view it on GitHub
<#72743 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKGAGE5WUCIXX7T3IXLETY3AXI7AVCNFSM6AAAAABFQD2LFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYHAYDMMRXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Renech and I talked on this in discord, we actually agreed to restrict it to a single ammo type because weird issues were happening where you would hit the "cancel" button on one ammo and it would not allow you to reload the furniture. Also I believe there was reasons involving the other parts of the code that needed to change for the furniture to actually consume the non-default ammo |
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.
This doesn't correctly consume charges for non default ammo.
Put 5 coal into a forge, craft crude glass lens. Examine forge. Notice that despite having done the recipe consuming 5 charges, there is still 5 coal to take out.
The above behavior was rectified in katemonster33's PR via 5c9ed5f |
Closing in favor of #72703 |
Summary
Bugfixes "Fixed reloading of furniture that allow multiple ammo types"
Purpose of change
The
reload_furniture
action was written assuming each furniture only alloweda single ammo type, which is no longer true, resulting in strange bugs when
mixing ammo types.
Fixes #68371.
Describe the solution
Refactored
reload_furniture
to enforce the invariant that only a single typeof ammo is present in the furniture at a time.
I also changed some pseudo crafting items to have the PSEUDO flag, which stops
the reload screen from showing "(0/2000)" when choosing ammo (even when there
is ammo present). The denominator there is also wrong for the forge as it
allows a different amount of max charges for coal vs charcoal.
And I fixed the ammo selection screen giving 2000 as the maximum amount of coal
to load at a time by changing
item::reload_option::qty
to check the ammoremaining for the specific ammo type being loaded.
Describe alternatives you've considered
Perhaps it should be allowable to mix ammo types? I didn't take that approach
because it seemed like it would be messy on the ammo usage side.
Testing
I manually tested:
Additional context