forked from mtcontrib/mobs_redo
Fix nil name error
This commit is contained in:
parent
053866c05b
commit
9990b12a12
3
api.lua
3
api.lua
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user