From 76d914647cb1cf60558bb0e62f149802a4aae2e0 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Sat, 2 Sep 2017 20:50:09 +0300 Subject: d --- src/Mobs/EnderDragon.cpp | 6 +++--- src/Mobs/Ocelot.cpp | 2 ++ src/Mobs/Ocelot.h | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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; } ; -- cgit v1.2.3