Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders

This commit is contained in:
Nicolas Chappe
2022-07-26 18:27:54 +02:00
committed by Michael Lutz
parent 4daad7f348
commit a9a21e784d
6 changed files with 12 additions and 8 deletions

View File

@@ -470,7 +470,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr
if (order_flags & OF_GOTO_NEAREST_DEPOT) odaf |= ODATFB_NEAREST_DEPOT;
OrderNonStopFlags onsf = (OrderNonStopFlags)((order_flags & OF_NON_STOP_INTERMEDIATE) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
if (order_flags & OF_GOTO_NEAREST_DEPOT) {
order.MakeGoToDepot(0, odtf, onsf, odaf);
order.MakeGoToDepot(INVALID_DEPOT, odtf, onsf, odaf);
} else {
/* Check explicitly if the order is to a station (for aircraft) or
* to a depot (other vehicle types). */