bendeutsch / minetest-thirsty

A Minetest mod that adds a "thirst" mechanic
GNU Lesser General Public License v2.1
3 stars 10 forks source link

Error on entering saved world #2

Closed NathanSalapat closed 9 years ago

NathanSalapat commented 9 years ago

When trying to enter a saved world with the latest release I get this error. ServerError: ...athan/.minetest/games/Survive/mods/thirsty/functions.lua:205: attempt to perform arithmetic on field 'thirst_factor' (a nil value) 2015-07-14 18:44:51: ERROR[main]: stack traceback: 2015-07-14 18:44:51: ERROR[main]: ...athan/.minetest/games/Survive/mods/thirsty/functions.lua:205: in function <...athan/.minetest/games/Survive/mods/thirsty/functions.lua:86>

From what I can tell the 'thirst_factor' doesn't get saved or read, which might be all the problem is, but deleting the thirst.dat in the world folder had no difference.

bendeutsch commented 9 years ago

Well, it could be caused by the thirsty.dat reading. I currently don't think it's worth saving thirst_factor (please correct me if I'm wrong here), but the reading part does attempt to initialize all the player's values; thirst_factor should at least be set to the default value there.

I've pushed a (potential) bug fix: 05f0cac0b42eb00b1fbdfe5bed18a37907c9d7f5 . I'd be grateful if you could give it a spin, and see if that fixes it.

NathanSalapat commented 9 years ago

I can't see why it would be worth saving, as if it is changed by the environment it would be changed back on the next check. Unless somebody wanted to do potions at some time?

I'll certainly give it a spin and let you know if it is working for me.

bendeutsch commented 9 years ago

Thanks! Since the bug fix is something that I probably should have done anyway (initializing a field), I went ahead and tagged it as a release, version 0.9.1. I'm still very much interested in whether this actually fixes the bug, of course.

NathanSalapat commented 9 years ago

Both of my worlds are now playable with Thirsty enabled, so I'd say this fixes it.