summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorBreeder.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 16:41:48 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 19:55:30 +0200
commit9711b06578e25fb92c8e6d10bd0f12bf593ed9db (patch)
treeb84d626e2216dc4010eef3060c950cc43c560e9e /src/Mobs/Behaviors/BehaviorBreeder.cpp
parentd (diff)
downloadcuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.gz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.bz2
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.lz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.xz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.zst
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Behaviors/BehaviorBreeder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Mobs/Behaviors/BehaviorBreeder.cpp b/src/Mobs/Behaviors/BehaviorBreeder.cpp
index ddca1715a..8ba991989 100644
--- a/src/Mobs/Behaviors/BehaviorBreeder.cpp
+++ b/src/Mobs/Behaviors/BehaviorBreeder.cpp
@@ -14,7 +14,7 @@ cBehaviorBreeder::cBehaviorBreeder(cMonster * a_Parent) :
m_LovePartner(nullptr),
m_LoveTimer(0),
m_LoveCooldown(0),
- m_MatingTimer(0),
+ m_MatingTimer(0)
{
m_Parent = a_Parent;
ASSERT(m_Parent != nullptr);
@@ -62,7 +62,7 @@ bool cBehaviorBreeder::ActiveTick()
}
cFastRandom Random;
- World->SpawnExperienceOrb(Pos.x, Pos.y, Pos.z, 1 + Random.NextInt(6));
+ World->SpawnExperienceOrb(Pos.x, Pos.y, Pos.z, 1 + (Random.RandInt() % 6));
m_LovePartner->GetBehaviorBreeder()->ResetLoveMode();
ResetLoveMode();
@@ -169,7 +169,9 @@ void cBehaviorBreeder::OnRightClicked(cPlayer & a_Player)
if ((m_LoveCooldown == 0) && !IsInLove() && !m_Parent->IsBaby())
{
short HeldItem = a_Player.GetEquippedItem().m_ItemType;
- if (m_BreedingItems.ContainsType(HeldItem))
+ cItems BreedingItems;
+ m_Parent->GetFollowedItems(BreedingItems);
+ if (BreedingItems.ContainsType(HeldItem))
{
if (!a_Player.IsGameModeCreative())
{