TBTR: Avoid built virtual wagons which can't be attached being orphaned

This commit is contained in:
Jonathan G Rennison
2019-06-11 01:59:50 +01:00
parent 5a2e498182
commit f3daada67f
2 changed files with 15 additions and 5 deletions

View File

@@ -1630,7 +1630,7 @@ struct BuildVehicleWindow : Window {
} else {
VehicleID target = (*(this->virtual_train_out))->GetLastUnit()->index;
DoCommandP(0, (1 << 21) | toadd->index, target, CMD_MOVE_RAIL_VEHICLE);
DoCommandP(0, (1 << 23) | (1 << 21) | toadd->index, target, CMD_MOVE_RAIL_VEHICLE);
}
InvalidateWindowClassesData(WC_CREATE_TEMPLATE);
InvalidateWindowClassesData(WC_TEMPLATEGUI_MAIN);