Don't add weapon wear in Creative Mode
This commit is contained in:
parent
3563b5448c
commit
0068508968
|
@ -2383,12 +2383,13 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
if cancel then return end
|
if cancel then return end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add weapon wear
|
|
||||||
if tool_capabilities then
|
if tool_capabilities then
|
||||||
punch_interval = tool_capabilities.full_punch_interval or 1.4
|
punch_interval = tool_capabilities.full_punch_interval or 1.4
|
||||||
end
|
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
|
and weapon:get_definition().tool_capabilities then
|
||||||
|
|
||||||
weapon:add_wear(floor((punch_interval / 75) * 9000))
|
weapon:add_wear(floor((punch_interval / 75) * 9000))
|
||||||
|
|
Loading…
Reference in New Issue