Add a release slot at front of train slot action.

Distinguish from release slot at back.
Fix slot release and acquire at front when passing PBS from back.
This commit is contained in:
Jonathan G Rennison
2017-03-31 01:10:26 +01:00
parent 870216d27c
commit 0772236986
5 changed files with 37 additions and 18 deletions

View File

@@ -471,8 +471,12 @@ void TraceRestrictProgram::Execute(const Train* v, const TraceRestrictProgramInp
if (input.permitted_slot_operations & TRPISP_ACQUIRE) slot->Occupy(v->index);
break;
case TRSCOF_RELEASE:
if (input.permitted_slot_operations & TRPISP_RELEASE) slot->Vacate(v->index);
case TRSCOF_RELEASE_BACK:
if (input.permitted_slot_operations & TRPISP_RELEASE_BACK) slot->Vacate(v->index);
break;
case TRSCOF_RELEASE_FRONT:
if (input.permitted_slot_operations & TRPISP_RELEASE_FRONT) slot->Vacate(v->index);
break;
default:
@@ -606,8 +610,12 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
actions_used_flags |= TRPAUF_SLOT_ACQUIRE;
break;
case TRSCOF_RELEASE:
actions_used_flags |= TRPAUF_SLOT_RELEASE;
case TRSCOF_RELEASE_BACK:
actions_used_flags |= TRPAUF_SLOT_RELEASE_BACK;
break;
case TRSCOF_RELEASE_FRONT:
actions_used_flags |= TRPAUF_SLOT_RELEASE_FRONT;
break;
default: