BlockMen / cme

Creatures MOB-Engine for Minetest
Other
18 stars 10 forks source link

[CRASH] init.lua : attempt to perform arithmetic on a nil value #1

Closed Ziusudra closed 10 years ago

Ziusudra commented 10 years ago
    00:14:24: ERROR[main]: ServerError: /home/ziusudra/.minetest/mods/creatures/init.lua:57: attempt to perform arithmetic on a nil value
    00:14:24: ERROR[main]: stack traceback:
    00:14:24: ERROR[main]:  /home/ziusudra/.minetest/mods/creatures/init.lua:57: in function 'func'
    00:14:24: ERROR[main]:  /usr/share/minetest/builtin/game/misc.lua:17: in function </usr/share/minetest/builtin/game/misc.lua:9>
    00:14:24: ERROR[main]:  /usr/share/minetest/builtin/game/register.lua:348: in function </usr/share/minetest/builtin/game/register.lua:336>

Arch Linux x86_64, https://github.com/minetest/minetest/commit/73e5bc9c011209be4f3aa7ee54a3fbf150259fa2 (AUR PKGBUILD), https://github.com/BlockMen/minetest_next/commit/9e5ce0ac0a342acd778501f2a8a3d4926a28e740, creatures git b449a66821 (no other mods)

All three mobs types had already spawned previously.

Could the callback to timer(tick) have done line 27 between line 47 and the call back to the function that does line 57?

BlockMen commented 10 years ago

Haven't tested yet, but that should fix it: https://github.com/BlockMen/creatures/commit/ec83599af3324a05941fd0eb3455f3eea6646ac1

Ziusudra commented 10 years ago

Confirmed fixed, tested with spawn_day=6 and a slightly increased delay on the spawn callback (and with normal values).