Don't add weapon wear in Creative Mode

This commit is contained in:
Wuzzy 2019-02-05 21:11:37 +01:00
parent 3563b5448c
commit 0068508968
1 changed files with 3 additions and 2 deletions

View File

@ -2383,12 +2383,13 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
if cancel then return end
end
-- add weapon wear
if tool_capabilities then
punch_interval = tool_capabilities.full_punch_interval or 1.4
end
if weapon:get_definition()
-- add weapon wear
if minetest.settings:get_bool("creative_mode") ~= true
and weapon:get_definition()
and weapon:get_definition().tool_capabilities then
weapon:add_wear(floor((punch_interval / 75) * 9000))