mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Revert #11606: Don't auto-build past tunnelbridge ends
This reverts commit 59f6c199bf
.
This commit is contained in:
parent
ebd258b404
commit
e0e0d5f8fb
@ -886,18 +886,9 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, TileI
|
|||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
bool had_success = false;
|
bool had_success = false;
|
||||||
bool under_tunnelbridge = false;
|
|
||||||
CommandCost last_error = CMD_ERROR;
|
CommandCost last_error = CMD_ERROR;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* Don't try to place rail between tunnelbridge ends */
|
ret = remove ? Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir)) : Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
|
||||||
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
|
||||||
under_tunnelbridge = !under_tunnelbridge;
|
|
||||||
} else if (!under_tunnelbridge) {
|
|
||||||
if (remove) {
|
|
||||||
ret = Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir));
|
|
||||||
} else {
|
|
||||||
ret = Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret.Failed()) {
|
if (ret.Failed()) {
|
||||||
last_error = ret;
|
last_error = ret;
|
||||||
@ -912,7 +903,6 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, TileI
|
|||||||
had_success = true;
|
had_success = true;
|
||||||
total_cost.AddCost(ret);
|
total_cost.AddCost(ret);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (tile == end_tile) break;
|
if (tile == end_tile) break;
|
||||||
|
|
||||||
|
@ -1007,14 +1007,9 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex end_tile, TileIndex
|
|||||||
bool had_bridge = false;
|
bool had_bridge = false;
|
||||||
bool had_tunnel = false;
|
bool had_tunnel = false;
|
||||||
bool had_success = false;
|
bool had_success = false;
|
||||||
bool under_tunnelbridge = false;
|
|
||||||
|
|
||||||
/* Start tile is the first tile clicked by the user. */
|
/* Start tile is the first tile clicked by the user. */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* Don't try to place road between tunnelbridge ends */
|
|
||||||
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
|
||||||
under_tunnelbridge = !under_tunnelbridge;
|
|
||||||
} else if (!under_tunnelbridge) {
|
|
||||||
RoadBits bits = AxisToRoadBits(axis);
|
RoadBits bits = AxisToRoadBits(axis);
|
||||||
|
|
||||||
/* Determine which road parts should be built. */
|
/* Determine which road parts should be built. */
|
||||||
@ -1057,7 +1052,6 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex end_tile, TileIndex
|
|||||||
cost.AddCost(ret);
|
cost.AddCost(ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (tile == end_tile) break;
|
if (tile == end_tile) break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user