Tracerestrict: Remove slot acquire on reservation flags
This commit is contained in:
@@ -2207,7 +2207,6 @@ class NIHTraceRestrict : public NIHelper {
|
||||
CA(TRAIN_NOT_STUCK)
|
||||
CA(CHANGE_COUNTER)
|
||||
CA(NO_PBS_BACK_PENALTY)
|
||||
CA(SLOT_ACQUIRE_ON_RES)
|
||||
CA(SPEED_ADAPTATION)
|
||||
CA(PBS_RES_END_SIMULATE)
|
||||
CA(RESERVE_THROUGH_ALWAYS)
|
||||
|
@@ -470,7 +470,6 @@ enum TraceRestrictProgramActionsUsedFlags {
|
||||
TRPAUF_TRAIN_NOT_STUCK = 1 << 11, ///< Train is not stuck
|
||||
TRPAUF_CHANGE_COUNTER = 1 << 12, ///< Change counter value is present
|
||||
TRPAUF_NO_PBS_BACK_PENALTY = 1 << 13, ///< No PBS back penalty is present
|
||||
TRPAUF_SLOT_ACQUIRE_ON_RES = 1 << 14, ///< Slot acquire (on reserve) action is present
|
||||
TRPAUF_SPEED_ADAPTATION = 1 << 15, ///< Speed adaptation control
|
||||
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
|
||||
@@ -490,7 +489,6 @@ enum TraceRestrictProgramInputSlotPermissions : uint8_t {
|
||||
TRPISP_PBS_RES_END_ACQ_DRY = 1 << 4, ///< Dry-run slot acquire (PBS reservations ending at this signal) is permitted
|
||||
TRPISP_PBS_RES_END_RELEASE = 1 << 5, ///< Slot release (PBS reservations ending at this signal) is permitted
|
||||
TRPISP_CHANGE_COUNTER = 1 << 6, ///< Change counter value is permitted
|
||||
TRPISP_ACQUIRE_ON_RES = 1 << 7, ///< Slot acquire (reserving route) is permitted
|
||||
};
|
||||
DECLARE_ENUM_AS_BIT_SET(TraceRestrictProgramInputSlotPermissions)
|
||||
|
||||
|
@@ -4264,10 +4264,10 @@ static void TryLongReserveChooseTrainTrack(Train *v, TileIndex tile, Trackdir td
|
||||
long_reserve = (out.flags & TRPRF_LONG_RESERVE);
|
||||
}
|
||||
if (!long_reserve) return;
|
||||
if (prog != nullptr && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE | TRPAUF_SLOT_ACQUIRE_ON_RES)) {
|
||||
if (prog != nullptr && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE)) {
|
||||
TraceRestrictProgramResult out;
|
||||
TraceRestrictProgramInput input(exit_tile, exit_td, nullptr, nullptr);
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE | TRPISP_ACQUIRE_ON_RES;
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE;
|
||||
prog->Execute(v, input, out);
|
||||
if (out.flags & TRPRF_WAIT_AT_PBS) {
|
||||
return;
|
||||
@@ -4373,10 +4373,10 @@ static Track ChooseTrainTrack(Train *v, TileIndex tile, DiagDirection enterdir,
|
||||
if (track != INVALID_TRACK && HasPbsSignalOnTrackdir(tile, TrackEnterdirToTrackdir(track, enterdir)) && !IsNoEntrySignal(tile, track)) {
|
||||
if (IsRestrictedSignal(tile) && v->force_proceed != TFP_SIGNAL) {
|
||||
const TraceRestrictProgram *prog = GetExistingTraceRestrictProgram(tile, track);
|
||||
if (prog && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE | TRPAUF_SLOT_ACQUIRE_ON_RES | TRPAUF_TRAIN_NOT_STUCK)) {
|
||||
if (prog && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE | TRPAUF_TRAIN_NOT_STUCK)) {
|
||||
TraceRestrictProgramResult out;
|
||||
TraceRestrictProgramInput input(tile, TrackEnterdirToTrackdir(track, enterdir), nullptr, nullptr);
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE | TRPISP_ACQUIRE_ON_RES;
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE;
|
||||
prog->Execute(v, input, out);
|
||||
if (out.flags & TRPRF_TRAIN_NOT_STUCK && !(v->track & TRACK_BIT_WORMHOLE) && !(v->track == TRACK_BIT_DEPOT)) {
|
||||
v->wait_counter = 0;
|
||||
@@ -5245,10 +5245,10 @@ static bool CheckTrainStayInWormHolePathReserve(Train *t, TileIndex tile)
|
||||
auto try_exit_reservation = [&]() -> bool {
|
||||
if (IsTunnelBridgeRestrictedSignal(tile)) {
|
||||
const TraceRestrictProgram *prog = GetExistingTraceRestrictProgram(tile, TrackdirToTrack(td));
|
||||
if (prog && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE | TRPAUF_SLOT_ACQUIRE_ON_RES)) {
|
||||
if (prog && prog->actions_used_flags & (TRPAUF_WAIT_AT_PBS | TRPAUF_SLOT_ACQUIRE)) {
|
||||
TraceRestrictProgramResult out;
|
||||
TraceRestrictProgramInput input(tile, td, nullptr, nullptr);
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE | TRPISP_ACQUIRE_ON_RES;
|
||||
input.permitted_slot_operations = TRPISP_ACQUIRE;
|
||||
prog->Execute(t, input, out);
|
||||
if (out.flags & TRPRF_WAIT_AT_PBS) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user