diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 20:36:07 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 20:36:07 +0200 |
commit | c4cbc34be577338ce819b459b12d7b7e3feeea6d (patch) | |
tree | abebb2f45e5bbf371b960e3a568d7f2f976bf63d /src/Mobs/Behaviors/BehaviorCoward.cpp | |
parent | Pathfinder DontCare now a member variable (diff) | |
download | cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar.gz cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar.bz2 cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar.lz cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar.xz cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.tar.zst cuberite-c4cbc34be577338ce819b459b12d7b7e3feeea6d.zip |
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorCoward.cpp')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorCoward.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorCoward.cpp b/src/Mobs/Behaviors/BehaviorCoward.cpp index 132735e0f..e1b0d2a25 100644 --- a/src/Mobs/Behaviors/BehaviorCoward.cpp +++ b/src/Mobs/Behaviors/BehaviorCoward.cpp @@ -40,6 +40,9 @@ bool cBehaviorCoward::ControlStarting(std::chrono::milliseconds a_Dt, cChunk & a { UNUSED(a_Dt); UNUSED(a_Chunk); + m_OldDontCare = m_Parent->GetPathFinder().getDontCare(); + m_Parent->GetPathFinder().setDontCare(true); // We don't care we're we are going when + // wandering. If a path is not found, the pathfinder just modifies our destination. m_Parent->SetRelativeWalkSpeed(m_Parent->GetRelativeWalkSpeed() * 3); return true; } @@ -50,6 +53,7 @@ bool cBehaviorCoward::ControlEnding(std::chrono::milliseconds a_Dt, cChunk & a_C UNUSED(a_Dt); UNUSED(a_Chunk); m_Parent->SetRelativeWalkSpeed(m_Parent->GetRelativeWalkSpeed() / 3); + m_Parent->GetPathFinder().setDontCare(m_OldDontCare); return true; } |