1
0

(duplicate) AI - Livestock escape fixed, water jumping fixed

This commit is contained in:
wiseoldman95
2015-05-06 17:23:07 +03:00
parent bd73dcedd4
commit b8aa38b18d
3 changed files with 79 additions and 34 deletions

View File

@@ -54,31 +54,6 @@ cPath::cPath(
return;
}
// If destination in water, set water surface as destination.
cChunk * Chunk = m_Chunk->GetNeighborChunk(m_Destination.x, m_Destination.z);
if ((Chunk != nullptr) && Chunk->IsValid())
{
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
int RelX = m_Destination.x - Chunk->GetPosX() * cChunkDef::Width;
int RelZ = m_Destination.z - Chunk->GetPosZ() * cChunkDef::Width;
bool inwater = false;
for (;;)
{
Chunk->GetBlockTypeMeta(RelX, m_Destination.y, RelZ, BlockType, BlockMeta);
if (BlockType != E_BLOCK_STATIONARY_WATER)
{
break;
}
inwater = true;
m_Destination+=Vector3d(0, 1, 0);
}
if (inwater)
{
m_Destination+=Vector3d(0, -1, 0);
}
}
m_Status = ePathFinderStatus::CALCULATING;
m_StepsLeft = a_MaxSteps;