Tracerestrict: Add flag for whether reserve through is always set

This commit is contained in:
Jonathan G Rennison
2022-06-11 16:40:32 +01:00
parent 5a02a13885
commit 02dabad81e
3 changed files with 7 additions and 0 deletions

View File

@@ -931,6 +931,11 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
case TRIT_RESERVE_THROUGH:
actions_used_flags |= TRPAUF_RESERVE_THROUGH;
if (GetTraceRestrictValue(item)) {
actions_used_flags &= ~TRPAUF_RESERVE_THROUGH_ALWAYS;
} else if (condstack.empty()) {
actions_used_flags |= TRPAUF_RESERVE_THROUGH_ALWAYS;
}
break;
case TRIT_LONG_RESERVE: