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

revert: "refactor: use std::clamp" #4007

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

scarf005
Copy link
Member

@scarf005 scarf005 commented Dec 29, 2023

Purpose of change

Describe the solution

due to item::charges_per_volume returning 0 when no charges fit in given volume, std::clamp(10, 1, 0) will return 0, which will always move entire stack of items.
previous expression, std::max(1, std::min(10, 0)) will return 1 and work correctly here

Describe alternatives you've considered

cri

Testing

image

was able to use plank to light up oven.

Additional context

urgent fix for 0.5.1

This reverts commit cee9587.

due to `item::charges_per_volume` returning 0 when no charges fit in given volume,
`std::clamp(10, 1, 0)` will return 0, which will always move entire stack of items.
@github-actions github-actions bot added the src PR changes related to source code. label Dec 29, 2023
Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pain is eternal :D

@scarf005 scarf005 merged commit 232bc01 into cataclysmbnteam:main Dec 29, 2023
12 checks passed
@scarf005 scarf005 deleted the fix-fire-source-charges branch December 29, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src PR changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use planks as firewood source
2 participants