Skip to content

Commit

Permalink
Fix polyrail endpoint update when removing
Browse files Browse the repository at this point in the history
  • Loading branch information
ldpl committed May 10, 2024
1 parent 06a70c3 commit 42e6f6b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rail_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,8 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, TileI
bool had_success = false;
CommandCost last_error = CMD_ERROR;
for (;;) {
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);

TileIndex last_endtile = _rail_track_endtile; // CM
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 (ret.Failed()) {
last_error = ret;
if (_rail_track_endtile == INVALID_TILE) _rail_track_endtile = last_endtile; // CM
Expand Down

0 comments on commit 42e6f6b

Please sign in to comment.