Add reserve through action to trace restrict programs.

This only changes the behaviour of PBS reservations which
would otherwise terminate at a PBS signal.
If the signal restriction sets the reserve through state,
the reservation continues through the signal, and the signal
is set to green.
This commit is contained in:
Jonathan G Rennison
2015-09-02 01:39:33 +01:00
parent 06cc930e47
commit 06a1d7c5c9
8 changed files with 126 additions and 4 deletions

View File

@@ -382,6 +382,14 @@ void TraceRestrictProgram::Execute(const Train* v, const TraceRestrictProgramInp
}
break;
case TRIT_RESERVE_THROUGH:
if (GetTraceRestrictValue(item)) {
out.flags &= ~TRPRF_RESERVE_THROUGH;
} else {
out.flags |= TRPRF_RESERVE_THROUGH;
}
break;
default:
NOT_REACHED();
}
@@ -502,6 +510,7 @@ void SetTraceRestrictValueDefault(TraceRestrictItem &item, TraceRestrictValueTyp
case TRVT_DENY:
case TRVT_SPEED:
case TRVT_TILE_INDEX:
case TRVT_RESERVE_THROUGH:
SetTraceRestrictValue(item, 0);
SetTraceRestrictAuxField(item, 0);
break;