From c4cbc34be577338ce819b459b12d7b7e3feeea6d Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Fri, 1 Sep 2017 21:36:07 +0300 Subject: d --- src/Mobs/Behaviors/BehaviorCoward.cpp | 4 ++++ src/Mobs/Behaviors/BehaviorCoward.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src/Mobs') 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; } diff --git a/src/Mobs/Behaviors/BehaviorCoward.h b/src/Mobs/Behaviors/BehaviorCoward.h index 3232f807b..16d68872c 100644 --- a/src/Mobs/Behaviors/BehaviorCoward.h +++ b/src/Mobs/Behaviors/BehaviorCoward.h @@ -19,4 +19,5 @@ public: private: cMonster * m_Parent; // Our Parent cEntity * m_Attacker; // The entity we're running away from + bool m_OldDontCare; }; -- cgit v1.2.3