mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r22329) -Change: When the current orders are interrupted for non-ordered service, disable modifications to automatic orders until the next real order is completed. (train part already slipped by in r22328)
This commit is contained in:
parent
194a941a37
commit
709f0e4f83
|
@ -1580,6 +1580,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetBit(v->gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
|
||||||
v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE);
|
v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE);
|
||||||
v->dest_tile = rfdd.tile;
|
v->dest_tile = rfdd.tile;
|
||||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||||
|
|
|
@ -1986,6 +1986,11 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command)
|
||||||
* then skip to the next order; effectively cancelling this forced service */
|
* then skip to the next order; effectively cancelling this forced service */
|
||||||
if (this->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) this->IncrementRealOrderIndex();
|
if (this->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) this->IncrementRealOrderIndex();
|
||||||
|
|
||||||
|
if (this->IsGroundVehicle()) {
|
||||||
|
uint16 &gv_flags = this->GetGroundVehicleFlags();
|
||||||
|
SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
|
||||||
|
}
|
||||||
|
|
||||||
this->current_order.MakeDummy();
|
this->current_order.MakeDummy();
|
||||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH);
|
SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH);
|
||||||
}
|
}
|
||||||
|
@ -2001,6 +2006,11 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command)
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
if (this->current_order.IsType(OT_LOADING)) this->LeaveStation();
|
if (this->current_order.IsType(OT_LOADING)) this->LeaveStation();
|
||||||
|
|
||||||
|
if (this->IsGroundVehicle()) {
|
||||||
|
uint16 &gv_flags = this->GetGroundVehicleFlags();
|
||||||
|
SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
|
||||||
|
}
|
||||||
|
|
||||||
this->dest_tile = location;
|
this->dest_tile = location;
|
||||||
this->current_order.MakeGoToDepot(destination, ODTF_MANUAL);
|
this->current_order.MakeGoToDepot(destination, ODTF_MANUAL);
|
||||||
if (!(command & DEPOT_SERVICE)) this->current_order.SetDepotActionType(ODATFB_HALT);
|
if (!(command & DEPOT_SERVICE)) this->current_order.SetDepotActionType(ODATFB_HALT);
|
||||||
|
|
Loading…
Reference in New Issue