From d88094f87e9bbe9bd759754d3d2d9099ec135ffa Mon Sep 17 00:00:00 2001 From: bell07 Date: Wed, 10 Jan 2018 18:43:23 +0100 Subject: [PATCH] Be more tolerant agains unknown items in meshnode I disabled some mods and a ship produces crash with error ``` 2018-01-10 16:55:16: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'meshnode' in callback luaentity_Activate(): /usr/share/minetest/builtin/common/misc_helpers.lua:590: table index is nil 2018-01-10 16:55:16: ERROR[Main]: stack traceback: 2018-01-10 16:55:16: ERROR[Main]: /usr/share/minetest/builtin/common/misc_helpers.lua:590: in function 'copy' 2018-01-10 16:55:16: ERROR[Main]: .../games/whynot/mods/tools/meshnode/api.lua:40: in function 'get_tile_textures' 2018-01-10 16:55:16: ERROR[Main]: .../games/whynot/mods/tools/meshnode/api.lua:205: in function 'add_entity' 2018-01-10 16:55:16: ERROR[Main]: .../games/whynot/mods/tools/meshnode/init.lua:192: in function <.../games/whynot/mods/tools/meshnode/init.lua:160> ``` So this is a quick fix to get the world working again --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 9b5ebae..7fd9177 100644 --- a/api.lua +++ b/api.lua @@ -37,7 +37,7 @@ local function connects_to_group(pos, groups) end local function get_tile_textures(tiles) - local textures = table.copy(tiles) + local textures = table.copy(tiles or {}) for i, v in pairs(textures) do if type(v) == "table" then textures[i] = v.name or "blank.png"