summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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