summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 20:03:26 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 20:03:26 +0000
commitada30679605644a228be26850a76370fea723799 (patch)
treed098c10dc31b2131e91953543f2f3d5683b301eb /src/saveload
parent09d64ff79dfb8dd52355fe269a582fe75b2615e0 (diff)
downloadopenttd-ada30679605644a228be26850a76370fea723799.tar.xz
(svn r16387) -Codechange: use Aircraft instead of Vehicle where appropriate
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/vehicle_sl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 6673081e0..727b2d35b 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -167,11 +167,12 @@ void UpdateOldAircraft()
st->airport_flags = 0; // reset airport
}
- Vehicle *v_oldstyle;
- FOR_ALL_VEHICLES(v_oldstyle) {
+ Vehicle *v;
+ FOR_ALL_VEHICLES(v) {
/* airplane has another vehicle with subtype 4 (shadow), helicopter also has 3 (rotor)
* skip those */
- if (v_oldstyle->type == VEH_AIRCRAFT && IsNormalAircraft(v_oldstyle)) {
+ if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) {
+ Aircraft *v_oldstyle = (Aircraft *)v;
/* airplane in terminal stopped doesn't hurt anyone, so goto next */
if (v_oldstyle->vehstatus & VS_STOPPED && v_oldstyle->u.air.state == 0) {
v_oldstyle->u.air.state = HANGAR;
@@ -362,10 +363,10 @@ void AfterLoadVehicles(bool part_of_load)
/* In the case of a helicopter we will update the rotor sprites */
if (v->subtype == AIR_HELICOPTER) {
Vehicle *rotor = shadow->Next();
- rotor->cur_image = GetRotorImage(v);
+ rotor->cur_image = GetRotorImage((Aircraft *)v);
}
- UpdateAircraftCache(v);
+ UpdateAircraftCache((Aircraft *)v);
}
break;
default: break;