1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
Checking for water availability won't cause spurious warnings. New creature window enabled for testing.
This commit is contained in:
Michał W. Urbańczyk
2011-05-25 14:48:49 +00:00
parent 601bee9c0f
commit 8e57dba850
5 changed files with 17 additions and 13 deletions

View File

@ -6313,8 +6313,7 @@ int3 IBoatGenerator::bestLocation() const
for (int i = 0; i < offsets.size(); ++i)
{
const TerrainTile *tile = IObjectInterface::cb->getTile(o->pos + offsets[i]);
if (tile) //tile is in the map
if (const TerrainTile *tile = IObjectInterface::cb->getTile(o->pos + offsets[i], false)) //tile is in the map
{
if (tile->tertype == TerrainTile::water && (!tile->blocked || tile->blockingObjects.front()->ID == 8)) //and is water and is not blocked or is blocked by boat
return o->pos + offsets[i];