diff --git a/src/tracerestrict.cpp b/src/tracerestrict.cpp index 6b256827ce..5459af6286 100644 --- a/src/tracerestrict.cpp +++ b/src/tracerestrict.cpp @@ -963,9 +963,6 @@ CommandCost TraceRestrictProgram::Validate(const std::vector case TRIT_COND_UNDEFINED: case TRIT_COND_TRAIN_LENGTH: case TRIT_COND_MAX_SPEED: - case TRIT_COND_CURRENT_ORDER: - case TRIT_COND_NEXT_ORDER: - case TRIT_COND_LAST_STATION: case TRIT_COND_CARGO: case TRIT_COND_ENTRY_DIRECTION: case TRIT_COND_PBS_ENTRY_SIGNAL: @@ -973,7 +970,6 @@ CommandCost TraceRestrictProgram::Validate(const std::vector case TRIT_COND_PHYS_PROP: case TRIT_COND_PHYS_RATIO: case TRIT_COND_TRAIN_OWNER: - case TRIT_COND_TRAIN_STATUS: case TRIT_COND_LOAD_PERCENT: case TRIT_COND_COUNTER_VALUE: case TRIT_COND_TIME_DATE_VALUE: @@ -981,6 +977,26 @@ CommandCost TraceRestrictProgram::Validate(const std::vector case TRIT_COND_CATEGORY: break; + case TRIT_COND_CURRENT_ORDER: + case TRIT_COND_NEXT_ORDER: + case TRIT_COND_LAST_STATION: + actions_used_flags |= TRPAUF_ORDER_CONDITIONALS; + break; + + case TRIT_COND_TRAIN_STATUS: + switch (static_cast(GetTraceRestrictValue(item))) { + case TRTSVF_HEADING_TO_STATION_WAYPOINT: + case TRTSVF_HEADING_TO_DEPOT: + case TRTSVF_LOADING: + case TRTSVF_WAITING: + actions_used_flags |= TRPAUF_ORDER_CONDITIONALS; + break; + + default: + break; + } + break; + case TRIT_COND_TRAIN_IN_SLOT: case TRIT_COND_SLOT_OCCUPANCY: if (find_index(pbs_res_end_released_slots, GetTraceRestrictValue(item)) >= 0 || find_index(pbs_res_end_acquired_slots, GetTraceRestrictValue(item)) >= 0) { diff --git a/src/tracerestrict.h b/src/tracerestrict.h index 3f7fc7606c..3bb3abf5e4 100644 --- a/src/tracerestrict.h +++ b/src/tracerestrict.h @@ -436,6 +436,7 @@ enum TraceRestrictProgramActionsUsedFlags { TRPAUF_PBS_RES_END_SIMULATE = 1 << 16, ///< PBS reservations ending at this signal slot changes must be fully simulated in dry run mode TRPAUF_RESERVE_THROUGH_ALWAYS = 1 << 17, ///< Reserve through action is unconditionally set TRPAUF_CMB_SIGNAL_MODE_CTRL = 1 << 18, ///< Combined normal/shunt signal mode control + TRPAUF_ORDER_CONDITIONALS = 1 << 19, ///< Order conditionals are present }; DECLARE_ENUM_AS_BIT_SET(TraceRestrictProgramActionsUsedFlags)