1
0
Fork 0

Fix 4bd72e4a7846af: Fixed accidental changes to autorail/road AI behavior

pull/13968/head
Koen Bussemaker 2025-04-05 13:43:57 +02:00
parent 32e317bed7
commit 0e1776d132
2 changed files with 2 additions and 0 deletions

View File

@ -888,6 +888,7 @@ static CommandCost CmdRailTrackHelper(DoCommandFlags flags, TileIndex tile, Tile
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);
if (!remove && !fail_on_obstacle && last_error.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = true;
if (ret.Failed()) {
last_error = std::move(ret);

View File

@ -1020,6 +1020,7 @@ CommandCost CmdBuildLongRoad(DoCommandFlags flags, TileIndex end_tile, TileIndex
}
CommandCost ret = Command<CMD_BUILD_ROAD>::Do(flags, tile, bits, rt, drd, TownID::Invalid());
if (!is_ai && ret.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = true;
if (ret.Failed()) {
last_error = std::move(ret);
if (last_error.GetErrorMessage() != STR_ERROR_ALREADY_BUILT) {