mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-13 11:40:38 +02:00
Fix #521
This commit is contained in:
parent
b189356a63
commit
10463155d8
@ -2161,6 +2161,8 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
|
|||||||
node.land = tinfo->tertype != TerrainTile::water;
|
node.land = tinfo->tertype != TerrainTile::water;
|
||||||
node.theNodeBefore = NULL;
|
node.theNodeBefore = NULL;
|
||||||
|
|
||||||
|
bool leaveAsBlocked = false;
|
||||||
|
|
||||||
if((onLand || indeterminate(onLand)) && !node.land)//it's sea and we cannot walk on sea
|
if((onLand || indeterminate(onLand)) && !node.land)//it's sea and we cannot walk on sea
|
||||||
{
|
{
|
||||||
if (waterWalk || flying)
|
if (waterWalk || flying)
|
||||||
@ -2170,12 +2172,14 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
node.accessible = CGPathNode::BLOCKED;
|
node.accessible = CGPathNode::BLOCKED;
|
||||||
|
leaveAsBlocked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( tinfo->tertype == TerrainTile::rock//it's rock
|
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)
|
|| !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
|
|| !FoW[i][j][k] //tile is covered by the FoW
|
||||||
|
|| leaveAsBlocked
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
node.accessible = CGPathNode::BLOCKED;
|
node.accessible = CGPathNode::BLOCKED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user