Add reverse at waypoint orders.

The train will reverse when its tail is within the waypoint tile.
This is useful for reversing on train en-route, without creating
dedicated reversing sidings or platforms.
This commit is contained in:
Jonathan G Rennison
2015-10-28 23:50:22 +00:00
parent 78f8627c34
commit 7bcd090a0f
13 changed files with 81 additions and 5 deletions

View File

@@ -1315,7 +1315,7 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
break;
case OT_GOTO_WAYPOINT:
if (mof != MOF_NON_STOP) return CMD_ERROR;
if (mof != MOF_NON_STOP && mof != MOF_WAYPOINT_FLAGS) return CMD_ERROR;
break;
case OT_CONDITIONAL:
@@ -1397,6 +1397,10 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
case MOF_COND_DESTINATION:
if (data >= v->GetNumOrders()) return CMD_ERROR;
break;
case MOF_WAYPOINT_FLAGS:
if (data != (data & OWF_REVERSE)) return CMD_ERROR;
break;
}
if (flags & DC_EXEC) {
@@ -1486,6 +1490,10 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
order->SetConditionSkipToOrder(data);
break;
case MOF_WAYPOINT_FLAGS:
order->SetWaypointFlags((OrderWaypointFlags)data);
break;
default: NOT_REACHED();
}