1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Implemented Scuttle Boat and Dimension Door spells.

Fixed #417 and #418.
Moved / refactored some code. Minor fixes.
This commit is contained in:
Michał W. Urbańczyk
2010-03-20 22:17:19 +00:00
parent 047849a23e
commit 80f49badc9
27 changed files with 775 additions and 666 deletions

View File

@@ -2129,3 +2129,19 @@ CVictoryCondition::CVictoryCondition()
obj = NULL;
ID = allowNormalVictory = appliesToAI = count = 0;
}
bool TerrainTile::entrableTerrain(const TerrainTile *from /*= NULL*/) const
{
return entrableTerrain(from ? from->tertype != water : true, from ? from->tertype == water : true);
}
bool TerrainTile::entrableTerrain(bool allowLand, bool allowSea) const
{
return tertype != rock
&& (allowSea && tertype == water || allowLand && tertype != water);
}
bool TerrainTile::isClear(const TerrainTile *from /*= NULL*/) const
{
return entrableTerrain(from) && !blocked;
}