summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorSafwatHalaby <SafwatHalaby@users.noreply.github.com>2015-05-19 05:54:20 +0200
committerSafwatHalaby <SafwatHalaby@users.noreply.github.com>2015-05-20 19:42:35 +0200
commit8436e5d8bd0889830f8daa7a15f08b6772e106fe (patch)
tree68b959cc0ca2eaee66add4887fed70785e4ce283 /src/Mobs/Monster.cpp
parentMerge pull request #2074 from SafwatHalaby/rmUnique (diff)
downloadcuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar.gz
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar.bz2
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar.lz
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar.xz
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.tar.zst
cuberite-8436e5d8bd0889830f8daa7a15f08b6772e106fe.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 2b00f6959..f5d961096 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -177,13 +177,14 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
case ePathFinderStatus::NEARBY_FOUND:
{
m_NoPathToTarget = true;
- m_Path->AcceptNearbyPath();
+ m_PathFinderDestination = m_Path->AcceptNearbyPath();
break;
}
case ePathFinderStatus::PATH_NOT_FOUND:
{
- StopMovingToPosition(); // Give up pathfinding to that destination.
+ ResetPathFinding(); // Try to calculate a path again.
+ // Note that the next time may succeed, e.g. if a player breaks a barrier.
break;
}
case ePathFinderStatus::CALCULATING: