-
Notifications
You must be signed in to change notification settings - Fork 13
Fixed bug when CONSUME ORGANS presents non-maximum spleen use #18
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
base: master
Are you sure you want to change the base?
Conversation
When spleen usage is not capped to the spleen limit (e.g. CONSUME SIM ORGANS 10 10 0 NOMEAT), it could previously end up with 10/10/15 spleen usage due to a bug where the diet attempts to "fill" the spleen cleansed by Sliders or Pickle Juices (even though the spleen usage was 0 and nothing was cleansed) This fix adds a buffer to the spleen so that if any cleansers are consumed, there would actually be spleen to be cleansed. Any buffered spleen use is then removed from the end of the diet so that we do not consume past the user-defined limit after cleansing.
soolar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holy cow, this has been sitting here for a while, my bad! I'll test it out later today and merge if everything seems ok.
soolar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so bad at remembering PRs, sorry! >_<
A minor question about some code that I think should be unnecessary, so either remove it or convince me of its necessity and I'll merge! I will admit I might be wrong about it being unnecessary, since I wrote this so long ago, haha.
| //Fill spleen again if stomache cleared spleen | ||
| //This ensures that if the booze also clears spleen, that wouldn't be wasted | ||
| if(space.spleen > 0) | ||
| { | ||
| fill_spleen(d, space, max); | ||
| if(space.spleen > 0) | ||
| break; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? Hitting an organ cleanser that would overcleanse an organ should automatically be triggering for that organ to be filled in first, if I recall correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it is necessary because of how we are manipulating space.spleen by temporarily buffering it to a larger value/size. This may not trigger the spleen to be "overcleansed".
The reason for the buffer is to actually allow spleen consumables to be used. If space.spleen was set to 0, we would never use any spleen consumables, even if we could clear said spleen usage with cleansers after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it has been years since I've looked at this, and I'm not sure how relevant this is anymore in view of the hobopolis consumable nerfs
When spleen usage is not capped to the spleen limit (e.g. CONSUME SIM ORGANS 10 10 0 NOMEAT), it could previously end up with 10/10/15 spleen usage due to a bug where the diet attempts to "fill" the spleen cleansed by Sliders or Pickle Juices (even though the spleen usage was 0 and nothing was cleansed)
This fix adds a buffer to the spleen so that if any cleansers are consumed, there would actually be spleen to be cleansed. Any buffered spleen use is then removed from the end of the diet so that we do not consume past the user-defined limit after cleansing.