From 04ae3502a571370f68b2ab820e5233117d9a7aaa Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 1 Jul 2018 14:19:34 +0100 Subject: [PATCH] toolrank check bugfix --- api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 3ee2257..b19523f 100644 --- a/api.lua +++ b/api.lua @@ -2430,7 +2430,10 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) end if tr then - weapon:add_wear(toolranks.new_afteruse(weapon, hitter, nil, {wear = wear})) + if weapon:get_definition() + and weapon:get_definition().original_description then + weapon:add_wear(toolranks.new_afteruse(weapon, hitter, nil, {wear = wear})) + end else weapon:add_wear(wear) end