summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorSafwatHalaby <SafwatHalaby@users.noreply.github.com>2015-05-23 16:41:29 +0200
committerSafwatHalaby <SafwatHalaby@users.noreply.github.com>2015-05-23 21:16:19 +0200
commit7021547e99e1e169aff1ff0fada6f7e1e5349bcf (patch)
tree3b8666ec3dd322da5fbdea6fd464db1a7ff86646 /src/Mobs/Monster.cpp
parentMerge pull request #2086 from Seadragon91/master (diff)
downloadcuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar.gz
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar.bz2
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar.lz
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar.xz
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.tar.zst
cuberite-7021547e99e1e169aff1ff0fada6f7e1e5349bcf.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index f5d961096..1da4124ed 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -169,7 +169,7 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
m_NoPathToTarget = false;
m_NoMoreWayPoints = false;
m_PathFinderDestination = m_FinalDestination;
- m_Path = new cPath(a_Chunk, GetPosition().Floor(), m_PathFinderDestination.Floor(), 20);
+ m_Path = new cPath(a_Chunk, GetPosition(), m_PathFinderDestination, 20, GetWidth(), GetHeight());
}
switch (m_Path->Step(a_Chunk))
@@ -183,7 +183,7 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
case ePathFinderStatus::PATH_NOT_FOUND:
{
- ResetPathFinding(); // Try to calculate a path again.
+ StopMovingToPosition(); // Try to calculate a path again.
// Note that the next time may succeed, e.g. if a player breaks a barrier.
break;
}
@@ -203,7 +203,7 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
{
if ((m_Path->IsFirstPoint() || ReachedNextWaypoint()))
{
- m_NextWayPointPosition = Vector3d(0.5, 0, 0.5) + m_Path->GetNextPoint();
+ m_NextWayPointPosition = m_Path->GetNextPoint();
m_GiveUpCounter = 40; // Give up after 40 ticks (2 seconds) if failed to reach m_NextWayPointPosition.
}
}