minetest-mods / mob-engine

Mob Engine (formely Creatures MOB-Engine) is a mod(pack) for Minetest that provides a mob engine and several creatures to the game.
13 stars 5 forks source link

Crash in functions.lua:522 #23

Closed JDCodeIt closed 1 year ago

JDCodeIt commented 5 years ago

I received the following error message from the server. Apparently the sheep was eating a node that got unloaded before this line of code. One needs to check if the function returns nil and take appropriate action before using the nil return value.

ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'sheep' in callback luaentity_Step(): ...table-0.4/bin/../mods/mob-engine/creatures/functions.lua:522: attempt to index local 'n' (a nil value)

      local n = core.get_node_or_nil(self.eat_node)
      local nnn = n.name
...