From d37b840cf30ea987ab676f1a3631e112cac06244 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 May 2009 20:18:45 +0000 Subject: (svn r16389) -Codechange: use RoadVehicle instead of Vehicle where appropriate --- src/station.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/station.cpp') diff --git a/src/station.cpp b/src/station.cpp index 97713dfbf..8f5dfd3f2 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -108,7 +108,7 @@ Station::~Station() * @param v the vehicle to get the first road stop for * @return the first roadstop that this vehicle can load at */ -RoadStop *Station::GetPrimaryRoadStop(const Vehicle *v) const +RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const { RoadStop *rs = this->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK); @@ -459,7 +459,10 @@ RoadStop::~RoadStop() Vehicle *v; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_ROAD && v->u.road.slot == this) ClearSlot(v); + if (v->type != VEH_ROAD) continue; + RoadVehicle *rv = (RoadVehicle *)v; + + if (rv->u.road.slot == this) ClearSlot(rv); } } assert(num_vehicles == 0); @@ -535,7 +538,7 @@ void RoadStop::SetEntranceBusy(bool busy) * @param v the vehicle to get the next road stop for. * @return the next road stop accessible. */ -RoadStop *RoadStop::GetNextRoadStop(const Vehicle *v) const +RoadStop *RoadStop::GetNextRoadStop(const RoadVehicle *v) const { for (RoadStop *rs = this->next; rs != NULL; rs = rs->next) { /* The vehicle cannot go to this roadstop (different roadtype) */ -- cgit v1.2.3-54-g00ecf