1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-09-29 07:50:35 +02:00

fixed tamed dog crash and add test for NPC

This commit is contained in:
crabman77 2015-06-21 23:02:17 +02:00
parent 0eb94d5059
commit 822e54fa0c
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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