summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index ba8a974..2654e20 100644
--- a/api.lua
+++ b/api.lua
@@ -2960,13 +2960,14 @@ end
-- protect tamed mob with rune iten
function mobs:protect(self, clicker)
+ local name = clicker:get_player_name()
+
if self.tamed == false then
minetest.chat_send_player(name, S("Not tamed!"))
return false
end
local tool = clicker:get_wielded_item()
- local name = clicker:get_player_name()
if tool:get_name() == "mobs:protector" then