minetest-mods / 3d_armor

Visible player armor & wielded items for minetest
Other
17 stars 39 forks source link

Server error when receiving damage from mobs API #77

Closed ronoaldo closed 2 years ago

ronoaldo commented 2 years ago

I'm not sure how to reproduce, but it has been crashing on my server for a while and I have not much idea how to fix it.

2022-08-20 08:25:50: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '3d_armor' in callback luaentity_Step(): Runtime error from mod '3d_armor' in callback on_punchplayer(): /usr/share/minetest/mods/3d_armor
/3d_armor/api.lua:830: attempt to concatenate local 'element' (a ni
2022-08-20 08:25:50: ERROR[Main]: l value)
2022-08-20 08:25:50: ERROR[Main]: stack traceback:
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:830: in function 'get_element'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:659: in function 'get_weared_armor_elements'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:630: in function 'damage'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:605: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/3d_armor/3d_armor/init.lua:416: in function 'func'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:415>
2022-08-20 08:25:50: ERROR[Main]:       [C]: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/mobs/api.lua:2716: in function 'do_states'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/mobs/api.lua:3544: in function 'func'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
2022-08-20 08:25:50: ERROR[Main]: stack traceback:
2022-08-20 08:25:50: ERROR[Main]:       [C]: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/mobs/api.lua:2716: in function 'do_states'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/mods/mobs/api.lua:3544: in function 'func'
2022-08-20 08:25:50: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>

The server in question is Mercurio hosted at mars.ronoaldo.dev.br port 3000. Using latest version from Content DB.

BuckarooBanzay commented 2 years ago

Interesting, the code in question: https://github.com/minetest-mods/3d_armor/blob/e1a262ba20e4bf0a1046ca06d83953ae0983f621/3d_armor/api.lua#L830

Could you dump out the content of armor.elements if possible? This might be a mod interop issue 🤔

BuckarooBanzay commented 2 years ago

@ronoaldo let me know if you still have this issue, i'll close this in a reasonable amount of time (tm) if there is no activity :wink:

ronoaldo commented 2 years ago

Sorry for the delay. Yeah I could not reproduce reliably, and the problem seems to have gone away... Perhaps it was other updates I made that fixed the issue. I'm no upgrading server to 5.6.1 so it would be safe to close this. I'll close as of now - thanks for the help investigating it!