Fix horse breeding

This commit is contained in:
jordan4ibanez 2021-04-24 18:36:22 -04:00
parent 39f7d0cf3c
commit c2cb15a47f
2 changed files with 11 additions and 8 deletions

View file

@ -160,7 +160,7 @@ mobs.make_baby_grow_faster = function(self,clicker)
local stack = clicker:get_wielded_item()
--safety check
if not stack then
return
return(false)
end
local item_name = stack:get_name()
@ -172,6 +172,10 @@ mobs.make_baby_grow_faster = function(self,clicker)
stack:take_item()
clicker:set_wielded_item(stack)
end
return(true)
end
end
return(false)
end

View file

@ -219,18 +219,17 @@ local horse = {
local heal = 0
--sneak click to breed the horse/feed it
if self.owner and self.owner == clicker:get_player_name() and clicker:get_player_control().sneak then
if self.owner and self.owner == clicker:get_player_name() then
--attempt to enter breed state
if mobs.enter_breed_state(self,clicker) then
return
end
end
--make baby grow faster
if self.baby then
mobs.make_baby_grow_faster(self,clicker)
return
end
--don't do any other logic with the baby
--make baby grow faster
if self.baby then
mobs.make_baby_grow_faster(self,clicker)
return
end