1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-09-27 15:20:20 +02:00

Fix nil name error

This commit is contained in:
TenPlus1 2016-11-10 11:36:46 +00:00
parent 053866c05b
commit 9990b12a12

View File

@ -2960,13 +2960,14 @@ end
-- protect tamed mob with rune iten -- protect tamed mob with rune iten
function mobs:protect(self, clicker) function mobs:protect(self, clicker)
local name = clicker:get_player_name()
if self.tamed == false then if self.tamed == false then
minetest.chat_send_player(name, S("Not tamed!")) minetest.chat_send_player(name, S("Not tamed!"))
return false return false
end end
local tool = clicker:get_wielded_item() local tool = clicker:get_wielded_item()
local name = clicker:get_player_name()
if tool:get_name() == "mobs:protector" then if tool:get_name() == "mobs:protector" then