Tracerestrict: Add slot action mode, try to acquire (only on reserve)

This commit is contained in:
Jonathan G Rennison
2021-08-15 22:11:08 +01:00
parent be4c2be35b
commit b8d5113c5a
6 changed files with 22 additions and 3 deletions

View File

@@ -671,6 +671,10 @@ void TraceRestrictProgram::Execute(const Train* v, const TraceRestrictProgramInp
if (input.permitted_slot_operations & TRPISP_PBS_RES_END_RELEASE) slot->Vacate(v->index);
break;
case TRSCOF_ACQUIRE_TRY_ON_RESERVE:
if (input.permitted_slot_operations & TRPISP_ACQUIRE_ON_RES) slot->Occupy(v->index);
break;
default:
NOT_REACHED();
break;
@@ -924,6 +928,10 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
actions_used_flags |= TRPAUF_PBS_RES_END_SLOT;
break;
case TRSCOF_ACQUIRE_TRY_ON_RESERVE:
actions_used_flags |= TRPAUF_SLOT_ACQUIRE_ON_RES;
break;
default:
NOT_REACHED();
break;