mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-17 07:50:29 +01:00
fixed tamed dog crash and add test for NPC
This commit is contained in:
parent
0eb94d5059
commit
822e54fa0c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user