summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-11-08 16:48:33 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2016-11-08 16:48:33 +0000
commit053866c05b333241dece9de9f0db3502aa835b6a (patch)
tree4354d5225cef6521c198a01aa9f79b2bd5c2749a /api.lua
parentb71369f487c5810af09783c82400d036069853ec (diff)
added player check for protected hits
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index bd9e969..ba8a974 100644
--- a/api.lua
+++ b/api.lua
@@ -1849,7 +1849,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
end
-- is mob protected?
-if self.protected
+if self.protected and hitter:is_player()
and minetest.is_protected(self.object:getpos(), hitter:get_player_name()) then
minetest.chat_send_player(hitter:get_player_name(), "Mob has been protected!")
return