maikerumine / mobs_mc

MC like mobs from many authors. This should be complete when released.
GNU General Public License v3.0
22 stars 9 forks source link

mobs:explosion is deprecated, must use mobs:boom instead #130

Open Wuzzy2 opened 7 years ago

Wuzzy2 commented 7 years ago

I just stumpled upon this code in wither.lua:

mobs:explosion(pos, 3, 0, 1)  --WHY THE ACTUAL FUCK DOES THIS NOT WORK ANYMORE?  Because wuzzy uses his own mobs.
               mobs:explosion(pos, 3)   --USE THIS IF USING MINECLONE

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 use mobs:boom instead. Sadly, I haven't found a way to invoke mobs:boom without crashing the game (Minetest complains about a sounds table to be missing).

I tried mobs:boom(self, pos, 3) to replace mobs:explosion above but it caused the aforementioned crash.

@tenplus1, what is the correct way to invoke mobs:boom? We need to invoke an explosion in hit_node of an arrow.

maikerumine commented 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>

maikerumine commented 7 years ago

It is traced to your tnt code.

Wuzzy2 commented 7 years ago

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.

Wuzzy2 commented 7 years ago

The crash in mcl_tnt was indeed by fault. I got the dependencies wrong. I have fixed this crash now.