Jump to content

Magic Hunger Reduction when splitting stews. (solution provided)


Hugo Qwerty

Recommended Posts

I heard about this yesterday from the Twitch steamer SuckingOnChilidawgs, who mentioned it on a Retanaru stream.

 

If you eat part of a pot of stew, but then split the remaining stew into two bowls, the hunger reduction of the bowls is based on the hunger reduction of the whole pot of stew - and not the remaining stew left in the pot, i.e. you gain hunger reduction (but not calories) from nowhere.

 

I've looked at the code, and done some testing to confirm this is indeed the case.


The offending code is in Recipe.OnCreate.MakeBowlOfStew2:
result:setHungChange(item:getBaseHunger() / 2);

(line ~600 of recipecode.lua, not sure of exact line as I added a few print calls while testing).

The code in Recipe.OnCreate.MakeBowlOfStew4 works correctly.

result:setHungChange(item:getHungChange() / 4);


The two equivalent soup functions also work correctly.

However, the same bug can be found in Recipe.OnCreate.SliceBreadDough, line ~625

PS:  As an aside, you could probably write a helper function to do the 'splitting', so you could then just do something like:

for i=0,items:size() - 1 do
	local item = items:get(i)
	if item:getType() == "PotOfStew" then
		splitIntoPortions(item, 2)
	end
end

 

Then you'd only need one piece of code to deal with the splitting into bowls/slices/etc, which could be use for all foods (stews, soups, bread, etc)

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...