diff options
author | smatz <smatz@openttd.org> | 2009-05-26 22:10:13 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-26 22:10:13 +0000 |
commit | 7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c (patch) | |
tree | 7107a4626a58464bd677e9fb8f7576cadf1b8bf2 /src/station.cpp | |
parent | aa546e513f6b121377fd1b6cad1b727f89b66528 (diff) | |
download | openttd-7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c.tar.xz |
(svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types
Diffstat (limited to 'src/station.cpp')
-rw-r--r-- | src/station.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
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); } } |