summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-21 06:35:34 +0000
committerrubidium <rubidium@openttd.org>2014-09-21 06:35:34 +0000
commitc0771b16570ad583ae530418f7149f2f79b21eb0 (patch)
tree25562edcedec3305c0e83f3dc222129724826158 /src/saveload
parentc88a4aaa5c853ccaf75006816c7d061fac79342b (diff)
downloadopenttd-c0771b16570ad583ae530418f7149f2f79b21eb0.tar.xz
(svn r26866) -Change: make aircraft ascend/descend when they are too close to the ground or too far away (based on patch by ic111)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp5
-rw-r--r--src/saveload/vehicle_sl.cpp3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index e5a1ecfd2..986803b23 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2374,7 +2374,10 @@ bool AfterLoadGame()
UpdateAircraftCache(v);
AircraftNextAirportPos_and_Order(v);
/* get aircraft back on running altitude */
- if ((v->vehstatus & VS_CRASHED) == 0) SetAircraftPosition(v, v->x_pos, v->y_pos, GetAircraftFlyingAltitude(v));
+ if ((v->vehstatus & VS_CRASHED) == 0) {
+ GetAircraftFlightLevelBounds(v, &v->z_pos, NULL);
+ SetAircraftPosition(v, v->x_pos, v->y_pos, GetAircraftFlightLevel(v));
+ }
}
}
}
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index af14d2d67..2d5ff7d51 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -200,7 +200,8 @@ void UpdateOldAircraft()
if (a->subtype == AIR_HELICOPTER) a->Next()->Next()->cur_speed = 32;
/* set new position x,y,z */
- SetAircraftPosition(a, gp.x, gp.y, GetAircraftFlyingAltitude(a));
+ GetAircraftFlightLevelBounds(a, &a->z_pos, NULL);
+ SetAircraftPosition(a, gp.x, gp.y, GetAircraftFlightLevel(a));
}
}
}