diff options
author | rubidium <rubidium@openttd.org> | 2009-07-22 08:59:57 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-22 08:59:57 +0000 |
commit | 68ead6b84f56ad3c93d05ad3e09b7fbb8173cf26 (patch) | |
tree | ee33bd19b96a138530a84e86e7ffd60c0700f9d9 /src/train_cmd.cpp | |
parent | 2646a99d29535a44c5998f080131cbca2e85bdcf (diff) | |
download | openttd-68ead6b84f56ad3c93d05ad3e09b7fbb8173cf26.tar.xz |
(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.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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); } } |