Update api.lua

Fix punch for mineclone2
This commit is contained in:
Josh 2023-04-03 02:44:27 -07:00 committed by GitHub
parent de5ddbd4c1
commit 68365273b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -445,7 +445,7 @@ function creatura.basic_punch_func(self, puncher, tflp, tool_caps, dir)
if puncher:is_player() then
tool = puncher:get_wielded_item()
tool_name = tool:get_name()
add_wear = not minetest.is_creative_enabled(puncher)
add_wear = not minetest.is_creative_enabled(puncher.get_player_name())
end
if (self.immune_to
and contains_val(self.immune_to, tool_name)) then