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

Crafting Input bus/buffer Overflow fix #2187

Merged
merged 2 commits into from Jul 28, 2023

Conversation

greatinfluence
Copy link
Contributor

In current implementation of Crafting Input bus/buffer, when a large amount of item/liquid is present, the stored numbers can overflow and present a negative value:

6e20f8f05607198203177bf1b0b88ab

This pull request fixes the problem by detecting if inserting the items/fluids will cause an overflow, otherwise prevent the insertion. The buffer now then will have an 2147483647 upper bound for everything inside each slots.

4b6bf18e40b3ff633fe30b7c93fd73f

71a5920ed8182763fe0edfb85c5c182

@Dream-Master Dream-Master requested review from a team July 26, 2023 20:07
Copy link
Contributor

@harrynull harrynull left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Contributor

@BlueWeabo BlueWeabo left a comment

Choose a reason for hiding this comment

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

it looks okay from the code perspective so it shouldn't overflow anymore. But I can see some inefficiencies in the code. But that isn't the scope of the PR. Good to merge

@Dream-Master Dream-Master merged commit edf6312 into GTNewHorizons:master Jul 28, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants