summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 20:18:45 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 20:18:45 +0000
commitd37b840cf30ea987ab676f1a3631e112cac06244 (patch)
treee66cefea331f2f4191a6c169e75e9f272b60ef1e /src/station.cpp
parentc882248348510265e1926b0abc031b4c6fb0f97f (diff)
downloadopenttd-d37b840cf30ea987ab676f1a3631e112cac06244.tar.xz
(svn r16389) -Codechange: use RoadVehicle instead of Vehicle where appropriate
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp9
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) */