diff options
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorWanderer.cpp')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorWanderer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorWanderer.cpp b/src/Mobs/Behaviors/BehaviorWanderer.cpp index b57d5f033..309883c01 100644 --- a/src/Mobs/Behaviors/BehaviorWanderer.cpp +++ b/src/Mobs/Behaviors/BehaviorWanderer.cpp @@ -35,6 +35,24 @@ bool cBehaviorWanderer::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk +bool cBehaviorWanderer::ControlStarting(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + UNUSED(a_Chunk); + m_OldDontCare = m_Parent->GetPathFinder().getDontCare(true); + 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. + return true; +} + + +bool cBehaviorWanderer::ControlEnding(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + UNUSED(a_Chunk); + m_Parent->GetPathFinder().setDontCare(m_OldDontCare); + return true; +} void cBehaviorWanderer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) |