饥荒联机版

饥荒联机版

Gardeneer Hat (Farming helper)
Faw 2022 年 7 月 1 日 下午 5:52
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)
最后由 Faw 编辑于; 2022 年 7 月 2 日 上午 5:21
< >
正在显示第 1 - 4 条,共 4 条留言
Viktor  [开发者] 2022 年 7 月 1 日 下午 6:58 
Thanks for pointing that bug out, I'll fix it but not now since I need to sleep now.
Viktor  [开发者] 2022 年 7 月 2 日 上午 6:41 
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 2022 年 7 月 2 日 上午 6:47 
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  [开发者] 2022 年 7 月 2 日 上午 6:51 
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.
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50