diff options
author | peter1138 <peter1138@openttd.org> | 2006-02-24 17:52:07 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-02-24 17:52:07 +0000 |
commit | af5a1d49c0b7b06496bfbd4d50514934ed362b3a (patch) | |
tree | a04d41f9cfc58910a1dad91f66aedfe65b4ef4e8 | |
parent | 2912d0e67bb21f4791f1f0059b244052ce57c516 (diff) | |
download | openttd-af5a1d49c0b7b06496bfbd4d50514934ed362b3a.tar.xz |
(svn r3663) - Fix: [Multistop] Check the status of the destination road stop instead of a station's first road stop. This only has effect with road vehicle queuing disabled.
-rw-r--r-- | roadveh_cmd.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index c1ffc1281..dac75c3fb 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -983,17 +983,12 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir) /* Road depot */ bitmask |= _road_veh_fp_ax_or[GB(_m[tile].m5, 0, 2)]; } - } else if (IsTileType(tile, MP_STATION)) { - if (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, v->owner)) { + } else if (IsTileType(tile, MP_STATION) && IsRoadStationTile(tile)) { + if (IsTileOwner(tile, v->owner)) { /* Our station */ - const Station* st = GetStation(_m[tile].m2); - byte val = _m[tile].m5; - if (v->cargo_type != CT_PASSENGERS) { - if (IS_BYTE_INSIDE(val, 0x43, 0x47) && (_patches.roadveh_queue || st->truck_stops->status&3)) - bitmask |= _road_veh_fp_ax_or[(val-0x43)&3]; - } else { - if (IS_BYTE_INSIDE(val, 0x47, 0x4B) && (_patches.roadveh_queue || st->bus_stops->status&3)) - bitmask |= _road_veh_fp_ax_or[(val-0x47)&3]; + 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)]; } } } |