summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-30 15:13:40 +0000
committerrubidium <rubidium@openttd.org>2008-06-30 15:13:40 +0000
commit4642e9f75a2f5eb30d6570fa8e8dae5e727fddba (patch)
tree52f5cfd63a70a45c369be2a335b616114c4b011b /src
parent490f013c588b46d95e44c978357bc5f78d3de6ea (diff)
downloadopenttd-4642e9f75a2f5eb30d6570fa8e8dae5e727fddba.tar.xz
(svn r13664) -Fix [FS#2117]: bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop.
Diffstat (limited to 'src')
-rw-r--r--src/roadveh_cmd.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 573182133..21bfb7df5 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1719,7 +1719,7 @@ again:
v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) {
RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
- Station* st = GetStationByTile(v->tile);
+ Station *st = GetStationByTile(v->tile);
/* Vehicle is at the stop position (at a bay) in a road stop.
* Note, if vehicle is loading/unloading it has already been handled,
@@ -1754,19 +1754,13 @@ again:
v->last_station_visited = st->index;
- if (IsDriveThroughStopTile(v->tile) || v->current_order.GetDestination() == st->index) {
+ if (IsDriveThroughStopTile(v->tile) || (v->current_order.IsType(OT_GOTO_STATION) && v->current_order.GetDestination() == st->index)) {
RoadVehArrivesAt(v, st);
v->BeginLoading();
- } else {
- v->current_order.MakeLeaveStation();
- InvalidateVehicleOrder(v);
+ return false;
}
-
- return false;
- }
-
- /* Vehicle is ready to leave a bay in a road stop */
- if (!v->current_order.IsType(OT_GOTO_DEPOT)) {
+ } else {
+ /* Vehicle is ready to leave a bay in a road stop */
if (rs->IsEntranceBusy()) {
/* Road stop entrance is busy, so wait as there is nowhere else to go */
v->cur_speed = 0;