From 7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 26 May 2009 22:10:13 +0000 Subject: (svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types --- src/station.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/station.cpp') diff --git a/src/station.cpp b/src/station.cpp index 57c9f150f..279bfbee8 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -69,11 +69,9 @@ Station::~Station() loading_vehicles.front()->LeaveStation(); } - Vehicle *v; - FOR_ALL_VEHICLES(v) { - if (v->type != VEH_AIRCRAFT || !IsNormalAircraft(v)) continue; - - Aircraft *a = (Aircraft *)v; + Aircraft *a; + FOR_ALL_AIRCRAFT(a) { + if (!IsNormalAircraft(a)) continue; if (a->targetairport == this->index) a->targetairport = INVALID_STATION; } @@ -463,12 +461,8 @@ RoadStop::~RoadStop() /* Clear the slot assignment of all vehicles heading for this road stop */ if (num_vehicles != 0) { - Vehicle *v; - - FOR_ALL_VEHICLES(v) { - if (v->type != VEH_ROAD) continue; - RoadVehicle *rv = (RoadVehicle *)v; - + RoadVehicle *rv; + FOR_ALL_ROADVEHICLES(rv) { if (rv->slot == this) ClearSlot(rv); } } -- cgit v1.2.3-54-g00ecf