summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorAggressive.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 14:50:17 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-24 14:50:17 +0200
commit7f5058f1872e1ecc2ea9b897e32708903480e702 (patch)
treeeb413f839b0e36c1bc05cb3c3e6bf2435a70810c /src/Mobs/Behaviors/BehaviorAggressive.cpp
parentMerge branch 'master' into mobs2 (diff)
downloadcuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar.gz
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar.bz2
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar.lz
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar.xz
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.tar.zst
cuberite-7f5058f1872e1ecc2ea9b897e32708903480e702.zip
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorAggressive.cpp')
-rw-r--r--src/Mobs/Behaviors/BehaviorAggressive.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Mobs/Behaviors/BehaviorAggressive.cpp b/src/Mobs/Behaviors/BehaviorAggressive.cpp
index f7c553f52..65618e123 100644
--- a/src/Mobs/Behaviors/BehaviorAggressive.cpp
+++ b/src/Mobs/Behaviors/BehaviorAggressive.cpp
@@ -6,21 +6,17 @@
#include "../../Chunk.h"
#include "../../Entities/Player.h"
-
-
-cBehaviorAggressive::cBehaviorAggressive(cMonster * a_Parent) : m_Parent(a_Parent)
+void cBehaviorAggressive::AttachToMonster(cMonster & a_Parent)
{
- ASSERT(m_Parent != nullptr);
- m_ParentChaser = m_Parent->GetBehaviorChaser();
- ASSERT(m_ParentChaser != nullptr);
+ m_Parent = &a_Parent;
+ m_Parent->AttachPreTickBehavior(this);
}
-
-
-
void cBehaviorAggressive::PreTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ UNUSED(a_Dt);
+ UNUSED(a_Chunk);
// Target something new if we have no target
if (m_ParentChaser->GetTarget() == nullptr)
{