mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-05 01:50:25 +01:00
fixed diamond not consumed when tamed npc
fixed npc follow diamond
This commit is contained in:
parent
3a94bc81b5
commit
64ff460668
|
@ -467,9 +467,9 @@ function mobs:register_mob(name, def)
|
|||
end
|
||||
end
|
||||
|
||||
if self.type == "npc" and self.order == "follow" and self.state ~= "attack" then
|
||||
if self.type == "npc" and self.order == "follow" and self.owner and self.owner ~= "" and self.state ~= "attack" then
|
||||
-- npc stop following player if not owner
|
||||
if self.following and self.type == "npc" and self.owner and self.owner ~= self.following:get_player_name() then
|
||||
if self.following and self.owner and self.owner ~= self.following:get_player_name() then
|
||||
self.following = nil
|
||||
end
|
||||
else
|
||||
|
|
|
@ -101,6 +101,7 @@ mobs:register_mob("mobs:npc", {
|
|||
self.diamond_count = (self.diamond_count or 0) + 1
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
if self.diamond_count < 4 then return end
|
||||
-- if owner switch between follow and stand
|
||||
|
|
Loading…
Reference in New Issue
Block a user