mirror of https://github.com/OpenTTD/OpenTTD
Codefix: Don't claim to allocate new waypoint when just checking (#12792)
parent
2f54904bab
commit
e3156546fa
|
@ -225,7 +225,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||||
/* Reuse an existing waypoint. */
|
/* Reuse an existing waypoint. */
|
||||||
if (wp->owner != _current_company) return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_WAYPOINT);
|
if (wp->owner != _current_company) return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_WAYPOINT);
|
||||||
|
|
||||||
/* check if we want to expand an already existing waypoint? */
|
/* Check if we want to expand an already existing waypoint. */
|
||||||
if (wp->train_station.tile != INVALID_TILE) {
|
if (wp->train_station.tile != INVALID_TILE) {
|
||||||
ret = CanExpandRailStation(wp, new_location);
|
ret = CanExpandRailStation(wp, new_location);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
@ -234,7 +234,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||||
ret = wp->rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TEST);
|
ret = wp->rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TEST);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
} else {
|
} else {
|
||||||
/* allocate and initialize new waypoint */
|
/* Check if we can create a new waypoint. */
|
||||||
if (!Waypoint::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
|
if (!Waypoint::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue