diff options
author | wiseoldman95 <softwatt@gmx.com> | 2015-05-01 17:53:24 +0200 |
---|---|---|
committer | wiseoldman95 <softwatt@gmx.com> | 2015-05-02 13:16:16 +0200 |
commit | 16b6fc9b5d59ac795e139b2a597da97953690d82 (patch) | |
tree | ad50db2fa44bd7fed1bbf5251eac78d4b076b483 /src/Mobs/Monster.cpp | |
parent | Merge pull request #1920 from wiseoldman95/SquashedPathFinder (diff) | |
download | cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar.gz cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar.bz2 cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar.lz cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar.xz cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.tar.zst cuberite-16b6fc9b5d59ac795e139b2a597da97953690d82.zip |
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r-- | src/Mobs/Monster.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e225ff9b1..e9b171e49 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -121,7 +121,7 @@ void cMonster::SpawnOn(cClientHandle & a_Client) -void cMonster::TickPathFinding() +void cMonster::TickPathFinding(cChunk & a_Chunk) { if (m_Path == nullptr) @@ -131,12 +131,12 @@ void cMonster::TickPathFinding() // Can someone explain why are these two NOT THE SAME??? // m_Path = new cPath(GetWorld(), GetPosition(), m_FinalDestination, 30); - m_Path = new cPath(GetWorld(), Vector3d(floor(position.x), floor(position.y), floor(position.z)), Vector3d(floor(Dest.x), floor(Dest.y), floor(Dest.z)), 20); + m_Path = new cPath(&a_Chunk, Vector3d(floor(position.x), floor(position.y), floor(position.z)), Vector3d(floor(Dest.x), floor(Dest.y), floor(Dest.z)), 20); m_IsFollowingPath = false; } - m_PathStatus = m_Path->Step(); + m_PathStatus = m_Path->Step(&a_Chunk); switch (m_PathStatus) { @@ -293,7 +293,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) } } - TickPathFinding(); + TickPathFinding(a_Chunk); Vector3d Distance = m_Destination - GetPosition(); if (!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move |