forked from VoxeLibre/VoxeLibre
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,21 +219,20 @@ 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
|
||||
|
||||
--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
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- Taming
|
||||
self.temper = self.temper or (math.random(1,100))
|
||||
|
||||
|
|
Loading…
Reference in New Issue