diff options
-rw-r--r-- | src/Mobs/EnderDragon.cpp | 6 | ||||
-rw-r--r-- | src/Mobs/Ocelot.cpp | 2 | ||||
-rw-r--r-- | src/Mobs/Ocelot.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/Mobs/EnderDragon.cpp b/src/Mobs/EnderDragon.cpp index 902c1d629..f33a9d888 100644 --- a/src/Mobs/EnderDragon.cpp +++ b/src/Mobs/EnderDragon.cpp @@ -11,9 +11,9 @@ cEnderDragon::cEnderDragon(void) : // TODO: Vanilla source says this, but is it right? Dragons fly, they don't stand super(mtEnderDragon, "entity.enderdragon.hurt", "entity.enderdragon.death", 16.0, 8.0) { - m_EMPersonality = AGGRESSIVE; - m_BehaviorDoNothing.AttachToMonster(*this); - GetMonsterConfig("EnderDragon"); + m_EMPersonality = AGGRESSIVE; + m_BehaviorDoNothing.AttachToMonster(*this); + GetMonsterConfig("EnderDragon"); } diff --git a/src/Mobs/Ocelot.cpp b/src/Mobs/Ocelot.cpp index de776dac6..cf4356f4f 100644 --- a/src/Mobs/Ocelot.cpp +++ b/src/Mobs/Ocelot.cpp @@ -21,6 +21,7 @@ cOcelot::cOcelot(void) : m_OwnerName("") { m_EMPersonality = PASSIVE; + m_BehaviorDoNothing.AttachToMonster(*this); GetMonsterConfig("Ocelot"); } @@ -31,6 +32,7 @@ cOcelot::cOcelot(void) : void cOcelot::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); + if (!IsTicking()) { // The base class tick destroyed us diff --git a/src/Mobs/Ocelot.h b/src/Mobs/Ocelot.h index d27467683..1c1b383cb 100644 --- a/src/Mobs/Ocelot.h +++ b/src/Mobs/Ocelot.h @@ -3,7 +3,7 @@ #include "Monster.h" #include "../UUID.h" - +#include "Behaviors/BehaviorDoNothing.h" @@ -68,6 +68,9 @@ protected: int m_CheckPlayerTickCount; AString m_OwnerName; cUUID m_OwnerUUID; + +private: + cBehaviorDoNothing m_BehaviorDoNothing; } ; |