Tracerestrict: Add a flag for whether slot conditionals are present

This commit is contained in:
Jonathan G Rennison
2024-01-20 20:31:56 +00:00
parent d502b6469d
commit a21a69c957
3 changed files with 5 additions and 2 deletions

View File

@@ -1286,6 +1286,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
case TRIT_COND_TRAIN_IN_SLOT:
case TRIT_COND_SLOT_OCCUPANCY:
actions_used_flags |= TRPAUF_SLOT_CONDITIONALS;
if (find_index(pbs_res_end_released_slots, GetTraceRestrictValue(item)) >= 0 || find_index(pbs_res_end_acquired_slots, GetTraceRestrictValue(item)) >= 0) {
actions_used_flags |= TRPAUF_PBS_RES_END_SIMULATE;
}
@@ -1350,7 +1351,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
case TRIT_SLOT:
switch (static_cast<TraceRestrictSlotCondOpField>(GetTraceRestrictCondOp(item))) {
case TRSCOF_ACQUIRE_WAIT:
actions_used_flags |= TRPAUF_SLOT_ACQUIRE | TRPAUF_WAIT_AT_PBS;
actions_used_flags |= TRPAUF_SLOT_ACQUIRE | TRPAUF_SLOT_CONDITIONALS | TRPAUF_WAIT_AT_PBS;
break;
case TRSCOF_ACQUIRE_TRY:
@@ -1367,7 +1368,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
break;
case TRSCOF_PBS_RES_END_ACQ_WAIT:
actions_used_flags |= TRPAUF_PBS_RES_END_SLOT | TRPAUF_PBS_RES_END_WAIT;
actions_used_flags |= TRPAUF_PBS_RES_END_SLOT | TRPAUF_PBS_RES_END_WAIT | TRPAUF_SLOT_CONDITIONALS ;
if (find_index(pbs_res_end_released_slots, GetTraceRestrictValue(item)) >= 0) actions_used_flags |= TRPAUF_PBS_RES_END_SIMULATE;
include(pbs_res_end_acquired_slots, GetTraceRestrictValue(item));
break;