Improve insertion and removal of 'or if' conditionals.

Allow inserting an 'or if' immediately after 'if', 'else if', 'or if'.
Removing an 'or if' no longer removes the associated block.
This commit is contained in:
Jonathan G Rennison
2015-09-01 22:39:15 +01:00
parent 38aaf8a921
commit 06cc930e47
2 changed files with 20 additions and 12 deletions

View File

@@ -807,7 +807,7 @@ CommandCost CmdProgramSignalTraceRestrict(TileIndex tile, DoCommandFlag flags, u
case TRDCT_REMOVE_ITEM: {
TraceRestrictItem old_item = *TraceRestrictProgram::InstructionAt(items, offset);
if (IsTraceRestrictConditional(old_item)) {
if (IsTraceRestrictConditional(old_item) && GetTraceRestrictCondFlags(old_item) != TRCF_OR) {
bool remove_whole_block = false;
if (GetTraceRestrictCondFlags(old_item) == 0) {
if (GetTraceRestrictType(old_item) == TRIT_COND_ENDIF) {