Feature: Order flag to unbunch vehicles at depot (#11945)
This commit is contained in:
+12
-2
@@ -387,7 +387,12 @@ CommandCost CmdTurnRoadVeh(DoCommandFlag flags, VehicleID veh_id)
|
||||
|
||||
if (IsTileType(v->tile, MP_TUNNELBRIDGE) && DirToDiagDir(v->direction) == GetTunnelBridgeDirection(v->tile)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) v->reverse_ctr = 180;
|
||||
if (flags & DC_EXEC) {
|
||||
v->reverse_ctr = 180;
|
||||
|
||||
/* Unbunching data is no longer valid. */
|
||||
v->ResetDepotUnbunching();
|
||||
}
|
||||
|
||||
return CommandCost();
|
||||
}
|
||||
@@ -1030,6 +1035,7 @@ bool RoadVehLeaveDepot(RoadVehicle *v, bool first)
|
||||
if (RoadVehFindCloseTo(v, x, y, v->direction, false) != nullptr) return true;
|
||||
|
||||
VehicleServiceInDepot(v);
|
||||
v->LeaveUnbunchingDepot();
|
||||
|
||||
StartRoadVehSound(v);
|
||||
|
||||
@@ -1587,7 +1593,11 @@ static bool RoadVehController(RoadVehicle *v)
|
||||
|
||||
if (v->current_order.IsType(OT_LOADING)) return true;
|
||||
|
||||
if (v->IsInDepot() && RoadVehLeaveDepot(v, true)) return true;
|
||||
if (v->IsInDepot()) {
|
||||
/* Check if we should wait here for unbunching. */
|
||||
if (v->IsWaitingForUnbunching()) return true;
|
||||
if (RoadVehLeaveDepot(v, true)) return true;
|
||||
}
|
||||
|
||||
v->ShowVisualEffect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user