Codechange: Use enum class and EnumBitSet for various order flags. (#14783)
This commit is contained in:
@@ -130,7 +130,7 @@ static StationID FindNearestHangar(const Aircraft *v)
|
||||
const Station *next_dest = nullptr;
|
||||
if (max_range != 0) {
|
||||
if (v->current_order.IsType(OT_GOTO_STATION) ||
|
||||
(v->current_order.IsType(OT_GOTO_DEPOT) && (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) == 0)) {
|
||||
(v->current_order.IsType(OT_GOTO_DEPOT) && !v->current_order.GetDepotActionType().Test(OrderDepotActionFlag::NearestDepot))) {
|
||||
last_dest = Station::GetIfValid(v->last_station_visited);
|
||||
next_dest = Station::GetIfValid(v->current_order.GetDestination().ToStationID());
|
||||
} else {
|
||||
@@ -428,7 +428,7 @@ static void CheckIfAircraftNeedsService(Aircraft *v)
|
||||
|
||||
/* only goto depot if the target airport has a depot */
|
||||
if (st->airport.HasHangar() && CanVehicleUseStation(v, st)) {
|
||||
v->current_order.MakeGoToDepot(st->index, ODTFB_SERVICE);
|
||||
v->current_order.MakeGoToDepot(st->index, OrderDepotTypeFlag::Service);
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
|
||||
} else if (v->current_order.IsType(OT_GOTO_DEPOT)) {
|
||||
v->current_order.MakeDummy();
|
||||
@@ -2187,7 +2187,7 @@ void UpdateAirplanesOnNewStation(const Station *st)
|
||||
Order *o = &v->current_order;
|
||||
/* The aircraft is heading to a hangar, but the new station doesn't have one,
|
||||
* or the aircraft can't land on the new station. Cancel current order. */
|
||||
if (o->IsType(OT_GOTO_DEPOT) && !(o->GetDepotOrderType() & ODTFB_PART_OF_ORDERS) && o->GetDestination() == st->index &&
|
||||
if (o->IsType(OT_GOTO_DEPOT) && !o->GetDepotOrderType().Test(OrderDepotTypeFlag::PartOfOrders) && o->GetDestination() == st->index &&
|
||||
(!st->airport.HasHangar() || !CanVehicleUseStation(v, st))) {
|
||||
o->MakeDummy();
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
|
||||
|
||||
Reference in New Issue
Block a user