forked from MineClone5/MineClone5
Fix horse breeding
This commit is contained in:
parent
39f7d0cf3c
commit
c2cb15a47f
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue