mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Digging: implement digging status on right click. Fix issue 401
This is also fix possibility to dig on some non-blockable objects like event.
This commit is contained in:
@ -146,6 +146,18 @@ bool TerrainTile::isCoastal() const
|
||||
return extTileFlags & 64;
|
||||
}
|
||||
|
||||
EDiggingStatus TerrainTile::getDiggingStatus(const bool excludeTop) const
|
||||
{
|
||||
if(terType == ETerrainType::WATER || terType == ETerrainType::ROCK)
|
||||
return EDiggingStatus::WRONG_TERRAIN;
|
||||
|
||||
int allowedBlocked = excludeTop ? 1 : 0;
|
||||
if(blockingObjects.size() > allowedBlocked || topVisitableObj(excludeTop))
|
||||
return EDiggingStatus::TILE_OCCUPIED;
|
||||
else
|
||||
return EDiggingStatus::CAN_DIG;
|
||||
}
|
||||
|
||||
bool TerrainTile::hasFavourableWinds() const
|
||||
{
|
||||
return extTileFlags & 128;
|
||||
|
Reference in New Issue
Block a user