Change: Allow overbuilding station and waypoint tiles (#10618)

This commit is contained in:
Tyler Trahan
2023-04-16 03:05:04 -04:00
committed by GitHub
parent 27b40da06a
commit bc44158f9a
2 changed files with 1 additions and 20 deletions

View File

@@ -195,15 +195,8 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
/* only AddCost for non-existing waypoints */
CommandCost cost(EXPENSES_CONSTRUCTION);
bool success = false;
for (TileIndex cur_tile : new_location) {
if (!IsRailWaypointTile(cur_tile)) {
cost.AddCost(_price[PR_BUILD_WAYPOINT_RAIL]);
success = true;
}
}
if (!success) {
return_cmd_error(STR_ERROR_ALREADY_BUILT);
if (!IsRailWaypointTile(cur_tile)) cost.AddCost(_price[PR_BUILD_WAYPOINT_RAIL]);
}
/* Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station) */