summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Path.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2015-05-06 08:38:31 +0200
committerAlexander Harkness <me@bearbin.net>2015-05-06 08:38:31 +0200
commitbd73dcedd4bdcfceb2a315f676e810ddcd6a3424 (patch)
tree7dd6bf3cb89b77e86e8b65d2d97b374f920b365f /src/Mobs/Path.cpp
parentMerge pull request #1943 from mc-server/revert-1917-CodeCleanup (diff)
parentPF - Swimming bugfix (diff)
downloadcuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.gz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.bz2
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.lz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.xz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.zst
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Path.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp
index 8701dad10..84d888bf2 100644
--- a/src/Mobs/Path.cpp
+++ b/src/Mobs/Path.cpp
@@ -60,12 +60,12 @@ cPath::cPath(
{
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
- int RelX = m_Destination.x - m_Chunk->GetPosX() * cChunkDef::Width;
- int RelZ = m_Destination.z - m_Chunk->GetPosZ() * cChunkDef::Width;
+ int RelX = m_Destination.x - Chunk->GetPosX() * cChunkDef::Width;
+ int RelZ = m_Destination.z - Chunk->GetPosZ() * cChunkDef::Width;
bool inwater = false;
for (;;)
{
- m_Chunk->GetBlockTypeMeta(RelX, m_Destination.y, RelZ, BlockType, BlockMeta);
+ Chunk->GetBlockTypeMeta(RelX, m_Destination.y, RelZ, BlockType, BlockMeta);
if (BlockType != E_BLOCK_STATIONARY_WATER)
{
break;
@@ -182,7 +182,13 @@ bool cPath::Step_Internal()
}
// Path found.
- if (CurrentCell->m_Location == m_Destination)
+ if (
+ (CurrentCell->m_Location == m_Destination + Vector3i(0, 0, 1)) ||
+ (CurrentCell->m_Location == m_Destination + Vector3i(1, 0, 0)) ||
+ (CurrentCell->m_Location == m_Destination + Vector3i(-1, 0, 0)) ||
+ (CurrentCell->m_Location == m_Destination + Vector3i(0, 0, -1)) ||
+ (CurrentCell->m_Location == m_Destination + Vector3i(0, -1, 0))
+ )
{
do
{