Skip to content

Conversation

@Pantocyclus
Copy link

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.

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.
Copy link
Owner

@soolar soolar left a 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.

Copy link
Owner

@soolar soolar left a 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.

Comment on lines +862 to +869
//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;
}
Copy link
Owner

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.

Copy link
Author

@Pantocyclus Pantocyclus Jul 23, 2024

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

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants