1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 22:54:29 +01:00

Fix #12591: Give descriptive error when station construction fails due to wrong layout (#12678)

This commit is contained in:
Tyler Trahan
2024-05-22 17:56:03 -04:00
committed by GitHub
parent b2f1a06def
commit 8f6e21617f
2 changed files with 4 additions and 3 deletions

View File

@@ -1389,9 +1389,8 @@ CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailTyp
/* Perform NewStation checks */
/* Check if the station size is permitted */
if (HasBit(statspec->disallowed_platforms, std::min(numtracks - 1, 7)) || HasBit(statspec->disallowed_lengths, std::min(plat_len - 1, 7))) {
return CMD_ERROR;
}
if (HasBit(statspec->disallowed_platforms, std::min(numtracks - 1, 7))) return_cmd_error(STR_ERROR_STATION_DISALLOWED_NUMBER_TRACKS);
if (HasBit(statspec->disallowed_lengths, std::min(plat_len - 1, 7))) return_cmd_error(STR_ERROR_STATION_DISALLOWED_LENGTH);
/* Check if the station is buildable */
if (HasBit(statspec->callback_mask, CBM_STATION_AVAIL)) {