summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-11-10 11:36:46 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2016-11-10 11:36:46 +0000
commit9990b12a1237e95bbf68ebc0abdf633403a64178 (patch)
tree1d45b8e3889364ab740e3345f06bdd19d56f7782
parent053866c05b333241dece9de9f0db3502aa835b6a (diff)
Fix nil name error
-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