summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-05-30 20:58:32 -0400
committerShadowNinja <shadowninja@minetest.net>2014-05-30 20:59:59 -0400
commit7c2f2d9630c03e12623a6e8941e007ee0e273b3d (patch)
tree1b28a5e51a352ee505ed6bb3dcb7e599e21f533b
parentb74c2d38b99417c0e69f66191dd8231d75366e36 (diff)
Fix crash when trying to repair unknown items
-rw-r--r--technic/machines/MV/tool_workshop.lua7
1 files 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