Don't Starve Together

Don't Starve Together

Gardeneer Hat (Farming helper)
Faw 1 Jul, 2022 @ 5:52pm
Couldn't find an asset matching images/Water5.xml
In you modmain.lua, when you are calculating water level to get the right texture there is a simple yet deadly bug.
Water level can exceed 1 (for a short period of time but that's enough to crash)
changing
local num = (water == 0.0 or not water) and 0 or math.ceil(water*4)
to
local num = (water == 0.0 or not water) and 0 or math.min(math.ceil(water*4),4)
should fix the problem.
it's in : local function UpdateNutrientsInfo(invert) , I belive line 437
please do the fix, even if ur not developing the mod anymore i belive many ppl still want to use it :)
PS: I think that comparision water == 0.0 is not needed and final line could be (not water and 0) or math.min(math.ceil(water * 4), 4)
Last edited by Faw; 2 Jul, 2022 @ 5:21am
< >
Showing 1-4 of 4 comments
Viktor  [developer] 1 Jul, 2022 @ 6:58pm 
Thanks for pointing that bug out, I'll fix it but not now since I need to sleep now.
Viktor  [developer] 2 Jul, 2022 @ 6:41am 
I pushed my update, the bug should be no more.
Also, instead of using math.min, I made use of math.clamp which is literally a combination of min and max to make sure that the value also can't go below zero because having negative water values is also possible now for some reason.
All of that feels more like a new bug because if you save while the water is greater than 100% and rollback afterwards, farms will loose their wetness graphics for a short time until it becomes less or equals 100%.
Faw 2 Jul, 2022 @ 6:47am 
If u say so that's even better. I wonder when and why it can go below zero i haven't notice that happening ever in my testings, once more very good job with the mod.
Have a nice day Viktor, and thanks for real quick fixing your product that's always nice to see
Viktor  [developer] 2 Jul, 2022 @ 6:51am 
Create a farm and plant e.g. 10x Watermelon Seeds there. After filling it with water you might realize that once the water gets close to 0% the water will drop below zero.
< >
Showing 1-4 of 4 comments
Per page: 1530 50