TheTermos / mobkit

Entity API for Minetest
MIT License
26 stars 12 forks source link

crash when try to read abr from mapgen settings #22

Closed berengma closed 4 years ago

berengma commented 4 years ago
2020-04-19 09:44:48: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'wildlife' in callback luaentity_Step(): .minetest/mods/mobkit/init.lua:712: attempt to perform arithmetic on upvalue 'abr' (a string value)
2020-04-19 09:44:48: ERROR[Main]: stack traceback:
2020-04-19 09:44:48: ERROR[Main]:       .minetest/mods/mobkit/init.lua:712: in function 'get_closest_entity'
2020-04-19 09:44:48: ERROR[Main]:      .minetest/mods/wildlife/init.lua:201: in function 'logic'
2020-04-19 09:44:48: ERROR[Main]:      .minetest/mods/mobkit/init.lua:957: in function </home/mars/.minetest/mods/mobkit/init.lua:937>

happens on my server using mapgen V6 solution is trivial :) for example like:

local abr = tonumber(minetest.get_mapgen_setting('active_block_range')) or 1

TheTermos commented 4 years ago

thanks, looking into

TheTermos commented 4 years ago

Do you know how it happens by any chance? I fail to reproduce this problem with mv6.

berengma commented 4 years ago

Yes that is a strange issue because it only happens on my server Jungle. I guess it has something to do with the lua version maybe. Someone had a similar issue with my water-life mod: https://github.com/berengma/water_life/pull/20

That never happened on my other servers or my desktop at home. An other thing that ocured on that server Jungle is a crash after running this: https://forum.minetest.net/viewtopic.php?p=372100#p372100

Goto command and ::gotohere:: unknown. That is what makes me think that there is a Lua version problem. But maybe I am totally wrong, being only an amateur X)

berengma commented 4 years ago

How it happens is difficult to say. The server is full of mods and 5yrs running now. I deleted mobs_redo and all mobs from it. Installed mobkit, wildlife, petz, aerotest and water_life. Started and server crashed. After adding the "tonumber" it was fixed and runs until today like that :)

TheTermos commented 4 years ago

Ok then, so I'm not going to know. Made the change anyway, thanks.

TheTermos commented 4 years ago

Turns out this could have been an engine bug. https://github.com/minetest/minetest/issues/9841

sfan5 commented 4 years ago

By the way active_block_range is not a mapgen setting, there is no reason to use minetest.get_mapgen_setting().

TheTermos commented 4 years ago

By the way active_block_range is not a mapgen setting, there is no reason to use minetest.get_mapgen_setting().

I think I had to use it for a reason, I'm going to check again.