From a30d76fb488245a1a96f573976d3fd66888ced45 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 5 Feb 2016 23:44:36 +0100 Subject: [PATCH] Work Table : fix crash on fail to fetch 'tiles' node definition --- worktable.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/worktable.lua b/worktable.lua index e3a949a..3062618 100644 --- a/worktable.lua +++ b/worktable.lua @@ -345,7 +345,7 @@ for _, d in pairs(worktable.defs) do for node in pairs(minetest.registered_nodes) do local def = minetest.registered_nodes[node] if worktable:nodes(def) and d[3] then - local groups, tiles = {}, {def.tiles[1]} + local groups, tiles = {}, {} groups.not_in_creative_inventory = 1 for k, v in pairs(def.groups) do @@ -354,8 +354,12 @@ for node in pairs(minetest.registered_nodes) do end end - if #def.tiles > 1 and not def.drawtype:find("glass") then - tiles = def.tiles + if def.tiles then + if #def.tiles > 1 and not def.drawtype:find("glass") then + tiles = def.tiles + else tiles = def.tiles[1] end + else + tiles = def.tile_images[1] end stairs.register_stair_and_slab(node:match(":(.*)"), node, groups, tiles,