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

Fix resource requirements when washing items with charges #35873

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

Davi-DeGanne
Copy link
Contributor

@Davi-DeGanne Davi-DeGanne commented Dec 5, 2019

Summary

SUMMARY: Bugfixes "Fix resource requirements when washing items with charges"

Purpose of change

Fixes #32800
Closes #32824

Describe the solution

Volume calculation was doing item.volume() * num_items, which would work if item.volume() always retrieved the volume of a single item/charge, but for items with charges, it retrieves the volume of the entire stack.

Simply dividing by the number of charges for items counted by charges did the trick.

Describe alternatives you've considered

Leaving a review for #32824 so that the author could correct his solution. Decided fixing it myself would take less effort, as he didn't seem very amenable, having argued with long-time contributors over several points (at least one of which he was objectively wrong about) and then disappeared without fixing his incorrect solution.

Testing

Spawn a clothing item and an equal volume of thread, both with the FILTHY flag. Also soap, water, and a washing kit. Check that they both use the same amount of resources to wash.

Additional context

image

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact labels Dec 5, 2019
@ZhilkinSerg ZhilkinSerg merged commit 34ac4b8 into CleverRaven:master Dec 5, 2019
@Davi-DeGanne Davi-DeGanne deleted the laundry-charges branch December 5, 2019 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleaning Threads (Filthy) Requires huge amounts of cleanser
2 participants