diff options
author | Gargaj <gargaj@conspiracy.hu> | 2015-11-29 19:13:31 +0100 |
---|---|---|
committer | Gargaj <gargaj@conspiracy.hu> | 2015-11-29 20:14:28 +0100 |
commit | 4ae3b64b077b444c8217f8da265cb5eedeaf699a (patch) | |
tree | 0da79374832cae75ae5d9e6822712b3b62cbdbe8 /src/Mobs/Monster.cpp | |
parent | Updated DumpInfo plugin (diff) | |
download | cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar.gz cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar.bz2 cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar.lz cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar.xz cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.tar.zst cuberite-4ae3b64b077b444c8217f8da265cb5eedeaf699a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.cpp | 11 |
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); + } + } } |