diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-24 09:25:50 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-24 09:25:50 +0200 |
commit | 4e5baf3f39c6972fb525b0d4aed58f59de3005bd (patch) | |
tree | 4bdf3c28f92ea2fdd469f0ec9c404df96fd6b78f /src/Mobs/Monster.cpp | |
parent | Initial Monster Behavior vector logic (diff) | |
download | cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.gz cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.bz2 cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.lz cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.xz cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.tar.zst cuberite-4e5baf3f39c6972fb525b0d4aed58f59de3005bd.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 7a33f3ce5..80da3b03a 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -306,7 +306,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) // They MUST NOT control mob movement or interefere with the main Tick. for (cBehavior * Behavior : PreTickBehaviors) { - Behavior->PreTick(); + Behavior->PreTick(a_Dt, a_Chunk); } // Note 1: Each monster tick, at most one Behavior executes its Tick method. @@ -320,7 +320,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) // Stop at the first one that says yes. for (cBehavior * Behavior : TickBehaviors) { - if (Behavior->IsControlDesired()) + if (Behavior->IsControlDesired(a_Dt, a_Chunk)) { m_NewTickControllingBehavior = Behavior; break; @@ -331,7 +331,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { // The Behavior asking for control is the same as the behavior from last tick. // Nothing special, just tick it. - m_CurrentTickControllingBehavior->Tick(); + m_CurrentTickControllingBehavior->Tick(a_Dt, a_Chunk); } else { @@ -345,7 +345,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) // Make the current controlling behavior clean up if (m_TickControllingBehaviorState == OldControlEnding) { - if (m_CurrentTickControllingBehavior->ControlEnding()) + if (m_CurrentTickControllingBehavior->ControlEnding(a_Dt, a_Chunk)) { // The current behavior told us it is ready for letting go of control m_TickControllingBehaviorState = NewControlStarting; @@ -360,7 +360,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) // Make the new controlling behavior set up else if (m_TickControllingBehaviorState == NewControlStarting) { - if (m_NewTickControllingBehavior->ControlStarting()) + if (m_NewTickControllingBehavior->ControlStarting(a_Dt, a_Chunk)) { // The new behavior told us it is ready for taking control // The new behavior is now the current behavior. Next tick it will execute its Tick. @@ -380,7 +380,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) // They MUST NOT control mob movement or interefere with the main Tick. for (cBehavior * Behavior : PostTickBehaviors) { - Behavior->PostTick(); + Behavior->PostTick(a_Dt, a_Chunk); } bool a_IsFollowingPath = false; |