Open Wuzzy2 opened 7 years ago
I'm getting more of a problem now when calling tnt:
2017-08-08 20:10:51: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mobs_mc' in callback luaentity_Step(): ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:30: attempt to call field 'player_damage' (a nil value) 2017-08-08 20:10:51: ERROR[Main]: stack traceback: 2017-08-08 20:10:51: ERROR[Main]: ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:30: in function 'do_tnt_physics' 2017-08-08 20:10:51: ERROR[Main]: ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:174: in function 'boom' 2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:3019: in function 'boom' 2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:3009: in function 'explosion' 2017-08-08 20:10:51: ERROR[Main]: D:\MTSERVER-TEST\bin\..\mods\mobs_mc/wither.lua:150: in function 'hit_node' 2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:2953: in function <...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:2915>
It is traced to your tnt code.
Error in readable form:
2017-08-08 20:10:51: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mobs_mc' in callback luaentity_Step(): ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:30: attempt to call field 'player_damage' (a nil value)
2017-08-08 20:10:51: ERROR[Main]: stack traceback:
2017-08-08 20:10:51: ERROR[Main]: ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:30: in function 'do_tnt_physics'
2017-08-08 20:10:51: ERROR[Main]: ...TEST\bin\..\games\MineClone2\mods\ITEMS\mcl_tnt\init.lua:174: in function 'boom'
2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:3019: in function 'boom'
2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:3009: in function 'explosion'
2017-08-08 20:10:51: ERROR[Main]: D:\MTSERVER-TEST\bin\..\mods\mobs_mc/wither.lua:150: in function 'hit_node'
2017-08-08 20:10:51: ERROR[Main]: ...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:2953: in function <...-TEST\bin\..\games\MineClone2\mods\ENTITIES\mobs/api.lua:2915>
Please use “```” instead of “`” for long code blocks.
The crash in mcl_tnt
was indeed by fault. I got the dependencies wrong.
I have fixed this crash now.
I just stumpled upon this code in
wither.lua
:Why didn't you just tell me about the problem? If something is wrong in MCL2, I need to know it. Well, I just went ahead and fixed the incompability in MCL2 now (it was a bad conversion from my part, SORRY! The Mobs Redo in MCL2 is not supposed to be incompatible) and cleaned the section in
wither.lua
so it works in both MTG and MCL2. The sound explosion was also a duplicate, by the way, the sound is played by Mobs Redo already.But I have dug into this matter a bit. While the code works for now, I noticed that
mobs:explosion
is now deprecated and we must usemobs:boom
instead. Sadly, I haven't found a way to invokemobs:boom
without crashing the game (Minetest complains about a sounds table to be missing).I tried
mobs:boom(self, pos, 3)
to replacemobs:explosion
above but it caused the aforementioned crash.@tenplus1, what is the correct way to invoke
mobs:boom
? We need to invoke an explosion inhit_node
of an arrow.