1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 18:32:35 +01:00

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 GitHub
parent 6ebe64703f
commit 70bf84175f
3 changed files with 15 additions and 10 deletions

View File

@@ -891,7 +891,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{};
}