diff --git a/src/lang/english.txt b/src/lang/english.txt index 1733c8d0c2..9385e9f4cb 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5271,13 +5271,13 @@ STR_ERROR_START_AND_END_MUST_BE_IN :{WHITE}Start an STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH :{WHITE}... ends of bridge must both be on land STR_ERROR_BRIDGE_TOO_LONG :{WHITE}... bridge too long STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}Bridge would end out of the map -STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION :{WHITE}Bridge is too low for station -STR_ERROR_BRIDGE_TOO_LOW_FOR_ROADSTOP :{WHITE}Bridge is too low for road stop -STR_ERROR_BRIDGE_TOO_LOW_FOR_DOCK :{WHITE}Bridge is too low for dock -STR_ERROR_BRIDGE_TOO_LOW_FOR_BUOY :{WHITE}Bridge is too low for buoy -STR_ERROR_BRIDGE_TOO_LOW_FOR_RAIL_WAYPOINT :{WHITE}Bridge is too low for rail waypoint -STR_ERROR_BRIDGE_TOO_LOW_FOR_ROAD_WAYPOINT :{WHITE}Bridge is too low for road waypoint -STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK :{WHITE}Bridge is too low for lock +STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION :{WHITE}Bridge is {HEIGHT} too low for station +STR_ERROR_BRIDGE_TOO_LOW_FOR_ROADSTOP :{WHITE}Bridge is {HEIGHT} too low for road stop +STR_ERROR_BRIDGE_TOO_LOW_FOR_DOCK :{WHITE}Bridge is {HEIGHT} too low for dock +STR_ERROR_BRIDGE_TOO_LOW_FOR_BUOY :{WHITE}Bridge is {HEIGHT} too low for buoy +STR_ERROR_BRIDGE_TOO_LOW_FOR_RAIL_WAYPOINT :{WHITE}Bridge is {HEIGHT} too low for rail waypoint +STR_ERROR_BRIDGE_TOO_LOW_FOR_ROAD_WAYPOINT :{WHITE}Bridge is {HEIGHT} too low for road waypoint +STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK :{WHITE}Bridge is {HEIGHT} too low for lock # Tunnel related errors STR_ERROR_CAN_T_BUILD_TUNNEL_HERE :{WHITE}Can't build tunnel here... diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index bffab91a52..0b8703e53d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -891,7 +891,10 @@ static CommandCost IsStationBridgeAboveOk(TileIndex tile, std::span::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{}; } diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 6533d34f22..f0a1252a75 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -365,7 +365,8 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlags for (LockPart lock_part = LOCK_PART_MIDDLE; TileIndex t : {tile, tile - delta, tile + delta}) { if (IsBridgeAbove(t) && GetBridgeHeight(GetSouthernBridgeEnd(t)) < GetTileMaxZ(t) + GetLockPartMinimalBridgeHeight(lock_part)) { - return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK); + int height_diff = (GetTileMaxZ(tile) + GetLockPartMinimalBridgeHeight(lock_part) - GetBridgeHeight(GetSouthernBridgeEnd(t))) * TILE_HEIGHT_STEP; + return CommandCostWithParam(STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK, height_diff); } ++lock_part; } @@ -1445,7 +1446,8 @@ static CommandCost CheckBuildAbove_Water(TileIndex tile, DoCommandFlags flags, A if (IsWater(tile) || IsCoast(tile)) return CommandCost(); if (IsLock(tile)) { if (GetTileMaxZ(tile) + GetLockPartMinimalBridgeHeight(GetLockPart(tile)) <= height) return CommandCost(); - return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK); + int height_diff = (GetTileMaxZ(tile) + GetLockPartMinimalBridgeHeight(GetLockPart(tile)) - height) * TILE_HEIGHT_STEP; + return CommandCostWithParam(STR_ERROR_BRIDGE_TOO_LOW_FOR_LOCK, height_diff); } return Command::Do(flags, tile); }