mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing
This commit is contained in:
parent
33d99d27f4
commit
a896753ecc
@ -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. */
|
/* if nothing is selected as destination, try and find a matching vehicle to drag to. */
|
||||||
Train *dst;
|
Train *dst;
|
||||||
if (d == INVALID_VEHICLE) {
|
if (d == INVALID_VEHICLE) {
|
||||||
dst = src->IsEngine() ? nullptr : FindGoodVehiclePos(src);
|
dst = (src->IsEngine() || (flags & DC_AUTOREPLACE)) ? nullptr : FindGoodVehiclePos(src);
|
||||||
} else {
|
} else {
|
||||||
dst = Train::GetIfValid(d);
|
dst = Train::GetIfValid(d);
|
||||||
if (dst == nullptr) return CMD_ERROR;
|
if (dst == nullptr) return CMD_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user