From 6c880d1c209e2b0ef076f41998925da0b6ee33d0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 11 Jan 2009 14:09:09 +0000 Subject: [PATCH] (svn r14990) -Codechange: handle articulated RVs and trams more strictly in GetStationTileForVehicle and CanVehicleUseStation (based on idea by Swallow) --- src/order_cmd.cpp | 2 +- src/vehicle.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index faa5c437e8..84a6778a84 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1371,7 +1371,7 @@ static TileIndex GetStationTileForVehicle(const Vehicle *v, const Station *st) case VEH_TRAIN: return st->train_tile; case VEH_AIRCRAFT: return st->airport_tile; case VEH_SHIP: return st->dock_tile; - case VEH_ROAD: return IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? st->bus_stops->xy : st->truck_stops->xy; + case VEH_ROAD: return st->GetPrimaryRoadStop(v)->xy; } } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 37fd1dd2af..86b07c7ffa 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2278,9 +2278,7 @@ bool CanVehicleUseStation(EngineID engine_type, const Station *st) */ bool CanVehicleUseStation(const Vehicle *v, const Station *st) { - if (v->type == VEH_ROAD) { - return (st->facilities & (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? FACIL_BUS_STOP : FACIL_TRUCK_STOP)) != 0; - } + if (v->type == VEH_ROAD) return st->GetPrimaryRoadStop(v) != NULL; return CanVehicleUseStation(v->engine_type, st); }