summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-05 12:43:04 +0000
committertron <tron@openttd.org>2004-12-05 12:43:04 +0000
commit7c2448ecea6ec47f9df4928ad3f42668936835ee (patch)
treef4ed902f473744cc8497d09b3f372d3da1524f4f /rail_cmd.c
parent1de8e294d892a70edbd1f4f3d3a6a141711f6648 (diff)
downloadopenttd-7c2448ecea6ec47f9df4928ad3f42668936835ee.tar.xz
(svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read. This changes preserves binary compatibility wrt savegames.
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index e373ac987..4b5eb17d8 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -760,8 +760,12 @@ int32 CmdBuildTrainWaypoint(int x, int y, uint32 flags, uint32 p1, uint32 p2)
static void DoDeleteWaypoint(Waypoint *cp)
{
+ Order order;
cp->xy = 0;
- DeleteCommandFromVehicleSchedule(((cp-_waypoints) << 8) + OT_GOTO_WAYPOINT);
+ order.type = OT_GOTO_WAYPOINT;
+ order.flags = 0;
+ order.station = cp - _waypoints;
+ DeleteCommandFromVehicleSchedule(order);
if (~cp->town_or_string & 0xC000) DeleteName(cp->town_or_string);
RedrawWaypointSign(cp);
}