(svn r3956) - 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. Backport of r3663, r3681 from trunk

This commit is contained in:
Darkvater 2006-03-18 15:28:26 +00:00
parent 4b938510a5
commit f470a87dea
2 changed files with 9 additions and 11 deletions

View File

@ -1006,17 +1006,15 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
/* Road depot */ /* Road depot */
bitmask |= _road_veh_fp_ax_or[GB(_m[tile].m5, 0, 2)]; bitmask |= _road_veh_fp_ax_or[GB(_m[tile].m5, 0, 2)];
} }
} else if (IsTileType(tile, MP_STATION)) { } else if (IsTileType(tile, MP_STATION) && IsRoadStationTile(tile)) {
if (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, v->owner)) { if (IsTileOwner(tile, v->owner)) {
/* Our station */ /* Our station */
const Station* st = GetStation(_m[tile].m2); RoadStopType rstype = (v->cargo_type == CT_PASSENGERS) ? RS_BUS : RS_TRUCK;
byte val = _m[tile].m5; if (GetRoadStopType(tile) == rstype) {
if (v->cargo_type != CT_PASSENGERS) { const RoadStop *rs = GetRoadStopByTile(tile, rstype);
if (IS_BYTE_INSIDE(val, 0x43, 0x47) && (_patches.roadveh_queue || st->truck_stops->status&3)) if (rs != NULL && (_patches.roadveh_queue || GB(rs->status, 0, 2) != 0)) {
bitmask |= _road_veh_fp_ax_or[(val-0x43)&3]; bitmask |= _road_veh_fp_ax_or[GetRoadStationDir(tile)];
} 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];
} }
} }
} }

View File

@ -202,7 +202,7 @@ void StationPickerDrawSprite(int x, int y, RailType railtype, int image);
uint32 GetCustomStationRelocation(const StationSpec *spec, const Station *st, byte ctype); uint32 GetCustomStationRelocation(const StationSpec *spec, const Station *st, byte ctype);
RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type); RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type);
static inline int GetRoadStopType(TileIndex tile) static inline RoadStopType GetRoadStopType(TileIndex tile)
{ {
return (_m[tile].m5 < 0x47) ? RS_TRUCK : RS_BUS; return (_m[tile].m5 < 0x47) ? RS_TRUCK : RS_BUS;
} }