1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-29 21:56:54 +02:00
This commit is contained in:
Michał W. Urbańczyk 2010-07-10 01:46:06 +00:00
parent b189356a63
commit 10463155d8

View File

@ -2161,6 +2161,8 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
node.land = tinfo->tertype != TerrainTile::water;
node.theNodeBefore = NULL;
bool leaveAsBlocked = false;
if((onLand || indeterminate(onLand)) && !node.land)//it's sea and we cannot walk on sea
{
if (waterWalk || flying)
@ -2170,12 +2172,14 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
else
{
node.accessible = CGPathNode::BLOCKED;
leaveAsBlocked = true;
}
}
if ( tinfo->tertype == TerrainTile::rock//it's rock
|| !onLand && node.land //it's land and we cannot walk on land (complementary condition is handled above)
|| !FoW[i][j][k] //tile is covered by the FoW
|| leaveAsBlocked
)
{
node.accessible = CGPathNode::BLOCKED;