Feature: Order flag to unbunch vehicles at depot (#11945)

This commit is contained in:
Tyler Trahan
2024-02-03 08:04:24 -05:00
committed by GitHub
parent a0c480c4e4
commit f6dd5053a3
20 changed files with 293 additions and 28 deletions

View File

@@ -387,6 +387,9 @@ static bool CheckShipLeaveDepot(Ship *v)
{
if (!v->IsChainInDepot()) return false;
/* Check if we should wait here for unbunching. */
if (v->IsWaitingForUnbunching()) return true;
/* We are leaving a depot, but have to go to the exact same one; re-enter */
if (v->current_order.IsType(OT_GOTO_DEPOT) &&
IsShipDepotTile(v->tile) && GetDepotIndex(v->tile) == v->current_order.GetDestination()) {
@@ -433,8 +436,9 @@ static bool CheckShipLeaveDepot(Ship *v)
v->UpdateViewport(true, true);
SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);
v->PlayLeaveStationSound();
VehicleServiceInDepot(v);
v->LeaveUnbunchingDepot();
v->PlayLeaveStationSound();
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
SetWindowClassesDirty(WC_SHIPS_LIST);