diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-25 06:38:56 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-25 06:38:56 +0200 |
commit | fbf5163a75fd85cdef16f29792a11cd988c57667 (patch) | |
tree | 7258ff1fbaa384993d9abc36f9decba505bf597a /src/Mobs/Behaviors/BehaviorCoward.cpp | |
parent | Fully working cows (diff) | |
download | cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar.gz cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar.bz2 cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar.lz cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar.xz cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.tar.zst cuberite-fbf5163a75fd85cdef16f29792a11cd988c57667.zip |
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorCoward.cpp')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorCoward.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/Mobs/Behaviors/BehaviorCoward.cpp b/src/Mobs/Behaviors/BehaviorCoward.cpp index 94997f065..c3afec67a 100644 --- a/src/Mobs/Behaviors/BehaviorCoward.cpp +++ b/src/Mobs/Behaviors/BehaviorCoward.cpp @@ -37,9 +37,32 @@ bool cBehaviorCoward::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & +bool cBehaviorCoward::ControlStarting(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + UNUSED(a_Chunk); + m_Parent->SetSpeed(m_Parent->GetSpeed() * 2); + return true; +} + + + + + +bool cBehaviorCoward::ControlEnding(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + UNUSED(a_Chunk); + m_Parent->SetSpeed(m_Parent->GetSpeed() / 2); + return true; +} + + + + + void cBehaviorCoward::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { - LOGD("mobDebug - Behavior Coward: Tick"); UNUSED(a_Dt); UNUSED(a_Chunk); if (m_Attacker == nullptr) @@ -52,6 +75,7 @@ void cBehaviorCoward::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { // We lost the attacker m_Attacker = nullptr; + return; } Vector3d newloc = m_Parent->GetPosition(); |