summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-27 19:43:19 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-27 19:43:19 +0000
commit23b13d3f421d5013e2a3219ba6fa0fae9b5337d6 (patch)
treebc4e2edd889cfc425d75bad9eecbd5323c74a484 /roadveh_cmd.c
parent263741bf9b247083d9d675741380efdf02bb0bcb (diff)
downloadopenttd-23b13d3f421d5013e2a3219ba6fa0fae9b5337d6.tar.xz
(svn r3681) - [Multistop] Check the RoadStop type before check its status. This fixes an assert introduced in r3663. Also fix the return type of GetRoadStopType().
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index dac75c3fb..84b9f9ab7 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -986,9 +986,12 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
} else if (IsTileType(tile, MP_STATION) && IsRoadStationTile(tile)) {
if (IsTileOwner(tile, v->owner)) {
/* Our station */
- const RoadStop *rs = GetRoadStopByTile(tile, (v->cargo_type == CT_PASSENGERS) ? RS_BUS : RS_TRUCK);
- if (rs != NULL && (_patches.roadveh_queue || GB(rs->status, 0, 2) != 0)) {
- bitmask |= _road_veh_fp_ax_or[GetRoadStationDir(tile)];
+ RoadStopType rstype = (v->cargo_type == CT_PASSENGERS) ? RS_BUS : RS_TRUCK;
+ if (GetRoadStopType(tile) == rstype) {
+ const RoadStop *rs = GetRoadStopByTile(tile, rstype);
+ if (rs != NULL && (_patches.roadveh_queue || GB(rs->status, 0, 2) != 0)) {
+ bitmask |= _road_veh_fp_ax_or[GetRoadStationDir(tile)];
+ }
}
}
}