diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index dc87827a75..3b16670948 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1178,7 +1178,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u /* if nothing is selected as destination, try and find a matching vehicle to drag to. */ Train *dst; if (d == INVALID_VEHICLE) { - dst = src->IsEngine() ? nullptr : FindGoodVehiclePos(src); + dst = (src->IsEngine() || (flags & DC_AUTOREPLACE)) ? nullptr : FindGoodVehiclePos(src); } else { dst = Train::GetIfValid(d); if (dst == nullptr) return CMD_ERROR;