-
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
Throw debugmsg when setting charges for items that cannot have charges #72780
Conversation
Oh yeah, the tests absolutely explode. We have deeper problems than just butchery, don't we? |
Co-authored-by: mqrause <[email protected]>
Chances are 99%+ of those errors set charges to 1. Because any value bigger than that should trigger charge removal after a save/load cycle, causing stuff to fall out once you interact with it. And I'd expect that would have been noticed already. |
Yeah that's what I'm seeing when running the tests locally, just lots of calls to the constructor with irrelevant quantities. I think I'm just going to paper over it by only throwing error on qty > 1 |
Chances are also good this is coming from limited sources like item group creation. |
Assuming this pass succeeds on GH I am going to consider removing the |
aa662c2
to
2fcfdc4
Compare
If there are too many complaints I'd suggest checking for >1 as suggested and then initiate a series of cleanup PRs, ending with the removal of the incorrectness hiding check. Especially in the light of the recent "too large" PR rules. |
IDK seems green. |
Throw debugmsg when setting charges for items that cannot have charges
Throw debugmsg when setting charges for items that cannot have charges Co-authored-by: RenechCDDA <[email protected]>
Summary
Bugfixes "Butchery properly gives a scaling amount of butchery refuse, instead of just 1"
Purpose of change
@GuardianDll raised a question in the development discord about butchery only giving 1 butchery refuse. Some checks later, I found out that constructor naively sets charges regardless of whether the type is allowed to have them or not. This results in an item with a
charges
defined, but that is handled by our code as not beingcount_by_charges()
, thus ignoring the value.Describe the solution
Only set charges if type is allowed to have charges
Debugmsg if type is not allowed to have charges
Fix existing butchery call
Describe alternatives you've considered
Testing
Additional context
"Charges are the devil" -kevingranade