mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-26 21:54:22 +01:00
Codechange: Use enum class and EnumBitSet for various order flags. (#14783)
This commit is contained in:
@@ -110,7 +110,7 @@ static bool CanDetermineTimeTaken(const Order &order, bool travelling)
|
||||
if (travelling && !order.IsTravelTimetabled()) return false;
|
||||
/* No wait time but we are loading at this timetabled station */
|
||||
if (!travelling && !order.IsWaitTimetabled() && order.IsType(OT_GOTO_STATION) &&
|
||||
!(order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) {
|
||||
!order.GetNonStopType().Test(OrderNonStopFlag::NoDestination)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ struct TimetableWindow : Window {
|
||||
{
|
||||
assert(v->vehicle_flags.Test(VehicleFlag::TimetableStarted));
|
||||
|
||||
bool travelling = (!v->current_order.IsType(OT_LOADING) || v->current_order.GetNonStopType() == ONSF_STOP_EVERYWHERE);
|
||||
bool travelling = (!v->current_order.IsType(OT_LOADING) || v->current_order.GetNonStopType().None());
|
||||
TimerGameTick::Ticks start_time = -v->current_order_time;
|
||||
|
||||
/* If arrival and departure times are in days, compensate for the current date_fract. */
|
||||
@@ -348,7 +348,7 @@ struct TimetableWindow : Window {
|
||||
if (selected % 2 != 0) {
|
||||
disable = order != nullptr && (order->IsType(OT_CONDITIONAL) || order->IsType(OT_IMPLICIT));
|
||||
} else {
|
||||
disable = order == nullptr || ((!order->IsType(OT_GOTO_STATION) || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) && !order->IsType(OT_CONDITIONAL));
|
||||
disable = order == nullptr || ((!order->IsType(OT_GOTO_STATION) || order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) && !order->IsType(OT_CONDITIONAL));
|
||||
}
|
||||
}
|
||||
bool disable_speed = disable || selected % 2 == 0 || v->type == VEH_AIRCRAFT;
|
||||
|
||||
Reference in New Issue
Block a user