summaryrefslogtreecommitdiffstats
path: root/src/Mobs/PathFinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/PathFinder.cpp')
-rw-r--r--src/Mobs/PathFinder.cpp46
1 files changed, 42 insertions, 4 deletions
diff --git a/src/Mobs/PathFinder.cpp b/src/Mobs/PathFinder.cpp
index 93664b596..8fdcb1ae6 100644
--- a/src/Mobs/PathFinder.cpp
+++ b/src/Mobs/PathFinder.cpp
@@ -9,7 +9,9 @@
cPathFinder::cPathFinder(double a_MobWidth, double a_MobHeight) :
m_Path(),
m_GiveUpCounter(0),
- m_NotFoundCooldown(0)
+ m_NotFoundCooldown(0),
+ m_DontCare(false),
+ m_AvoidSunlight(false)
{
m_Width = a_MobWidth;
m_Height = a_MobHeight;
@@ -19,7 +21,7 @@ cPathFinder::cPathFinder(double a_MobWidth, double a_MobHeight) :
-ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d & a_Source, Vector3d * a_Destination, Vector3d * a_OutputWaypoint, bool a_DontCare)
+ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d & a_Source, Vector3d * a_Destination, Vector3d * a_OutputWaypoint)
{
m_FinalDestination = *a_Destination;
m_Source = a_Source;
@@ -65,7 +67,7 @@ ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d
{
m_NoPathToTarget = true;
m_PathDestination = m_Path->AcceptNearbyPath();
- if (a_DontCare)
+ if (m_DontCare)
{
m_FinalDestination = m_PathDestination;
*a_Destination = m_FinalDestination; // Modify the mob's final destination because it doesn't care about reaching an exact spot
@@ -93,7 +95,7 @@ ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d
if (m_GiveUpCounter == 0)
{
- if (a_DontCare)
+ if (m_DontCare)
{
// We're having trouble reaching the next waypoint but the mob
// Doesn't care where to go, just tell him we got there ;)
@@ -166,6 +168,42 @@ ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d
+void cPathFinder::SetDontCare(bool a_DontCare)
+{
+ m_DontCare = a_DontCare;
+}
+
+
+
+
+
+bool cPathFinder::GetDontCare()
+{
+ return m_DontCare;
+}
+
+
+
+
+
+void cPathFinder::SetAvoidSunlight(bool a_AvoidSunlight)
+{
+ m_AvoidSunlight = a_AvoidSunlight;
+}
+
+
+
+
+
+bool cPathFinder::GetAvoidSunlight()
+{
+ return m_AvoidSunlight;
+}
+
+
+
+
+
void cPathFinder::ResetPathFinding(cChunk &a_Chunk)
{
m_GiveUpCounter = 40;