diff options
Diffstat (limited to 'src/station.cpp')
-rw-r--r-- | src/station.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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) */ |