summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorSafwat Halaby <SafwatHalaby@users.noreply.github.com>2015-11-30 07:58:02 +0100
committerSafwat Halaby <SafwatHalaby@users.noreply.github.com>2015-11-30 07:58:02 +0100
commit1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9 (patch)
tree0da79374832cae75ae5d9e6822712b3b62cbdbe8 /src/Mobs/Monster.cpp
parentUpdated DumpInfo plugin (diff)
parentimplement breeding (diff)
downloadcuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.gz
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.bz2
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.lz
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.xz
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.zst
cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 060b934ec..d1173c41c 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -104,6 +104,7 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A
, m_BurnsInDaylight(false)
, m_RelativeWalkSpeed(1)
, m_Age(1)
+ , m_AgingTimer(20 * 60 * 20) // about 20 minutes
{
if (!a_ConfigName.empty())
{
@@ -505,6 +506,16 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
} // switch (m_EMState)
BroadcastMovementUpdate();
+
+ if (m_AgingTimer > 0)
+ {
+ m_AgingTimer--;
+ if ((m_AgingTimer <= 0) && IsBaby())
+ {
+ SetAge(1);
+ m_World->BroadcastEntityMetadata(*this);
+ }
+ }
}