mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
move self.food check
This commit is contained in:
parent
9d52fed357
commit
120b096fc8
@ -4383,11 +4383,6 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake)
|
||||
|
||||
-- feed and tame
|
||||
|
||||
self.food = (self.food or 0) + 1
|
||||
if self.food >= feed_count then
|
||||
|
||||
self.food = 0
|
||||
|
||||
if tame then
|
||||
self.tamed = true
|
||||
if not self.owner or self.owner == "" then
|
||||
@ -4396,13 +4391,15 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if breed and not self.child and not consume_food
|
||||
and self.hornytimer == 0 and not self.horny then
|
||||
self.horny = true
|
||||
self.food = (self.food or 0) + 1
|
||||
consume_food = true
|
||||
if self.food >= feed_count then
|
||||
self.food = 0
|
||||
self.horny = true
|
||||
end
|
||||
-- make sound when fed so many times
|
||||
mob_sound(self, "random", true)
|
||||
end
|
||||
|
||||
update_tag(self)
|
||||
@ -4426,6 +4423,9 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake)
|
||||
end
|
||||
|
||||
clicker:set_wielded_item(item)
|
||||
else
|
||||
-- make sound when fed so many times
|
||||
mob_sound(self, "random", true)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user