Fix sheep getting horny from eating grass

This commit is contained in:
Wuzzy 2021-08-08 15:07:10 +02:00
parent fce8fd605d
commit 1ebe4d44f6
2 changed files with 22 additions and 20 deletions

View File

@ -1722,7 +1722,7 @@ end
-- Feeding, taming and breeding (thanks blert2112)
function mobs:feed_tame(self, clicker, feed_count, breed)
function mobs:feed_tame(self, clicker, feed_count, breed, effect)
-- Feed a mob(mostly a wrapper to handle self.check_fed)
local item = nil
@ -1747,8 +1747,9 @@ function mobs:feed_tame(self, clicker, feed_count, breed)
clicker:set_wielded_item(item)
end
end
mob_sound(self, self.sounds.eat, true)
if effect ~= false then
mob_sound(self, self.sounds.eat, true)
local mobpos = self.object:get_pos()
minetest.add_particlespawner(
{
@ -1766,6 +1767,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed)
maxsize = 2,
texture = "magicpuff.png"
})
end
self:check_fed(name, feed_count, breed)

View File

@ -65,7 +65,7 @@ mobs:register_mob(
on_replace = function(self, pos)
minetest.set_node(pos, {name = self.replace_with})
if mobs:feed_tame(self, self.follow, 8, true) then
if mobs:feed_tame(self, self.follow, 8, false, false) then
if self.gotten == false then
self.object:set_properties(
{