mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-23 16:30:19 +01:00
Fixed NPC taming
- Moved code wrongly placed after a merge (last May 22). Solves part of #94
This commit is contained in:
parent
5cdb105831
commit
94417bcafc
@ -102,6 +102,18 @@ mobs:register_mob("mobs:npc", {
|
|||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
item:take_item()
|
item:take_item()
|
||||||
end
|
end
|
||||||
|
if self.diamond_count < 4 then return end
|
||||||
|
-- if owner switch between follow and stand
|
||||||
|
if self.owner and self.owner == clicker:get_player_name() then
|
||||||
|
self.damages = 4
|
||||||
|
if self.order == "follow" then
|
||||||
|
self.order = "stand"
|
||||||
|
else
|
||||||
|
self.order = "follow"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self.owner = clicker:get_player_name()
|
||||||
|
end
|
||||||
-- pick up npc
|
-- pick up npc
|
||||||
elseif item:get_name() == "mobs:magic_lasso"
|
elseif item:get_name() == "mobs:magic_lasso"
|
||||||
and clicker:is_player()
|
and clicker:is_player()
|
||||||
@ -122,20 +134,6 @@ mobs:register_mob("mobs:npc", {
|
|||||||
elseif self.owner ~= name then
|
elseif self.owner ~= name then
|
||||||
minetest.chat_send_player(name, "Not owner!")
|
minetest.chat_send_player(name, "Not owner!")
|
||||||
end
|
end
|
||||||
if self.diamond_count < 4 then return end
|
|
||||||
|
|
||||||
else
|
|
||||||
-- if owner switch between follow and stand
|
|
||||||
if self.owner and self.owner == clicker:get_player_name() then
|
|
||||||
self.damages = 4
|
|
||||||
if self.order == "follow" then
|
|
||||||
self.order = "stand"
|
|
||||||
else
|
|
||||||
self.order = "follow"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
self.owner = clicker:get_player_name()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user