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:
@ -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];
|
||||
|
Reference in New Issue
Block a user