diff --git a/mods/mobs/dog.lua b/mods/mobs/dog.lua index 4f9e2eaa..68a9e7f3 100755 --- a/mods/mobs/dog.lua +++ b/mods/mobs/dog.lua @@ -37,6 +37,8 @@ mobs:register_mob("mobs:dog", { light_damage = 0, on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() + local name = clicker:get_player_name() + if not name then return end if item:get_name() == "mobs:meat_raw" then local hp = self.object:get_hp() -- return if full health diff --git a/mods/mobs/npc.lua b/mods/mobs/npc.lua index 8a623fc8..e6e21db0 100755 --- a/mods/mobs/npc.lua +++ b/mods/mobs/npc.lua @@ -67,7 +67,7 @@ mobs:register_mob("mobs:npc", { on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() local name = clicker:get_player_name() - + if not name then return end -- heal npc if item:get_name() == "mobs:meat" or item:get_name() == "farming:bread" then