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 wrong calorie count on batch crafted foods #55008

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Feb 2, 2022

Summary

Bugfixes "Fix wrong calorie count on batch crafted foods"

Purpose of change

Fixes #51361
Fixes #52429
Fixes #52676
Fixes #52628
Fixes #54469

Describe the solution

Merge components on the finished craft so their count doesn't get rounded down when divided by batch size.

Describe alternatives you've considered

Testing

  1. Spawn a fillet of fish
  2. wait an hour or so, then spawn another fillet of fish
  3. have two stacks of fillets of fish that don't combine
  4. batch craft two cooked fish
  5. without this fix the result has 0 calories, with it it has 260 per portion
  6. without this fix, save and load would fix the 0 charges components, resulting in one cooked fish made of two fillets of fish, doubling the calories

Additional context

The real fix, as so often, would be removing count_by_charges.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 2, 2022
src/crafting.cpp Outdated Show resolved Hide resolved
@NetSysFire NetSysFire added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Feb 2, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 2, 2022
Co-authored-by: NetSysFire <[email protected]>
@kevingranade kevingranade merged commit f8f74d2 into CleverRaven:master Feb 3, 2022
@mqrause mqrause deleted the zero_calories branch February 5, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling json-styled JSON lint passed, label assigned by github actions
Projects
None yet
3 participants