Add: Show height difference in bridge is too low error message. (#14614)

This commit is contained in:
Rito12
2025-10-24 22:27:11 +02:00
committed by dP
parent 91498a326b
commit 3a7260c2d6
3 changed files with 15 additions and 10 deletions
+4 -1
View File
@@ -894,7 +894,10 @@ static CommandCost IsStationBridgeAboveOk(TileIndex tile, std::span<const Bridge
/* Get normal error message associated with clearing the tile. */
return Command<CMD_LANDSCAPE_CLEAR>::Do(DoCommandFlag::Auto, tile);
}
if (GetTileMaxZ(tile) + height > bridge_height) return CommandCost{GetBridgeTooLowMessageForStationType(type)};
if (GetTileMaxZ(tile) + height > bridge_height) {
int height_diff = (GetTileMaxZ(tile) + height - bridge_height) * TILE_HEIGHT_STEP;
return CommandCostWithParam(GetBridgeTooLowMessageForStationType(type), height_diff);
}
return CommandCost{};
}