-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add max_charges to items that throw "cannot have charges" error #42603
Conversation
@@ -15,6 +15,7 @@ | |||
"material": [ "wood", "iron" ], | |||
"symbol": "|", | |||
"color": "white", | |||
"max_charges": 1, |
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.
I want to test whether instruments actually need charges, AFAIK they don't use them, but they might need one charge for the use invocation to work.
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.
I just tried the violin and it looks like they don't require charges, or at least the violin doesn't. I'll try a few others.
ETA: Tuba and guitar also don't need charges.
Co-authored-by: Alexey Mostovoy <1931904+AMurkin@users.noreply.github.com>
Summary
SUMMARY: [Bugfixes] "Add max_charges to items that throw 'cannot have charges' error"
Purpose of change
Suppress "cannot have charges" error and preserve charges in saves with items that have initial_charges set but not max_charges.
Describe the solution
Add max_charges field to every item I found with an initial_charges setting but not a max_charges setting. It's possible I missed a few.
Describe alternatives you've considered
We could try to add something in the code that automatically populates max_charges with whatever is set in initial_charges, but given that the current state of affairs seems to involve adding max_charges lines instead, there seems to be some reason we aren't doing that.
I also considered removing initial_charges from items with a battery pocket, but I'm not sure if that would have affected the function of those items.
Testing
This successfully gets rid of the "cannot have charges" error with items like harmonica_holder and scuba_tank and rebreather in my current save, started on 0.E-10811 and played on 0.E-10875. I don't know whether or not this causes other unexpected behavior, though.