From 68ead6b84f56ad3c93d05ad3e09b7fbb8173cf26 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 22 Jul 2009 08:59:57 +0000 Subject: (svn r16909) -Fix [FS#2996]: NewGRF stations would be triggering assertions all over the place when using the more advanced station types. -Change: make (rail) waypoints sub classes of 'base stations', make buoys waypoints and unify code between them where possible. --- src/train_cmd.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 5dfc29626..b954a0337 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -482,7 +482,7 @@ static int GetTrainAcceleration(Train *v, bool mode) assert(max_speed == GetTrainCurveSpeedLimit(v)); // safety check, will be removed later int speed = v->cur_speed * 10 / 16; // km-ish/h -> mp/h - if (IsTileType(v->tile, MP_STATION) && v->IsFrontEngine()) { + if (IsRailwayStationTile(v->tile) && v->IsFrontEngine()) { StationID sid = GetStationIndex(v->tile); if (v->current_order.ShouldStopAtStation(v, sid)) { int station_ahead; @@ -4443,12 +4443,10 @@ static bool TrainLocoHandler(Train *v, bool mode) OrderType order_type = v->current_order.GetType(); /* Do not skip waypoints (incl. 'via' stations) when passing through at full speed. */ - if ((order_type == OT_GOTO_WAYPOINT && - v->dest_tile == v->tile) || - (order_type == OT_GOTO_STATION && + if ((order_type == OT_GOTO_WAYPOINT || order_type == OT_GOTO_STATION) && (v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) && IsTileType(v->tile, MP_STATION) && - v->current_order.GetDestination() == GetStationIndex(v->tile))) { + v->current_order.GetDestination() == GetStationIndex(v->tile)) { ProcessOrders(v); } } -- cgit v1.2.3-54-g00ecf