From 7c2f2d9630c03e12623a6e8941e007ee0e273b3d Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 30 May 2014 20:58:32 -0400 Subject: [PATCH] Fix crash when trying to repair unknown items --- technic/machines/MV/tool_workshop.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index b00c3bb..67a37e6 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -62,9 +62,12 @@ minetest.register_abm({ local repairable = false local srcstack = inv:get_stack("src", 1) - if (not srcstack:is_empty("src")) then + if not srcstack:is_empty("src") then local itemdef = minetest.registered_items[srcstack:get_name()] - if (itemdef.wear_represents or "mechanical_wear") == "mechanical_wear" and srcstack:get_wear() ~= 0 then + if itemdef and + itemdef.wear_represents and + itemdef.wear_represents == "mechanical_wear" and + srcstack:get_wear() ~= 0 then repairable = true end end