summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-03-02 12:01:24 +0000
committercelestar <celestar@openttd.org>2007-03-02 12:01:24 +0000
commitf621608f7d142993b3185bc98c31c814455c519c (patch)
treefc8688953b36c1679e38f6949c6dbc0ad627ab66 /src/openttd.cpp
parent879eca8e23c11089dd40dd30a6514f0f83c44423 (diff)
downloadopenttd-f621608f7d142993b3185bc98c31c814455c519c.tar.xz
(svn r8973) -Feature/Codechange: Changed the internal unit for aircraft velocities to from 8mph to 1km/h (peter1138), also give aircraft realsitic velocities (so that 1km/h is 1km/h independent of vehicle type) (peter1138). Introduce a flag to reduce aircraft speed in holding patterns to some realistic velocity. Use this flag for the city airport for the time being and make use of the different entry points for this airport type.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index c1fb0c021..8dc6a36fe 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -40,6 +40,7 @@
#include "fileio.h"
#include "hal.h"
#include "airport.h"
+#include "aircraft.h"
#include "console.h"
#include "screenshot.h"
#include "network/network.h"
@@ -1818,6 +1819,20 @@ bool AfterLoadGame(void)
}
}
+ if (CheckSavegameVersion(50)) {
+ Vehicle *v;
+ /* Aircraft units changed from 8 mph to 1 km/h */
+ FOR_ALL_VEHICLES(v) {
+ if (v->type == VEH_Aircraft && v->subtype <= AIR_AIRCRAFT) {
+ const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
+ v->cur_speed *= 129;
+ v->cur_speed /= 10;
+ v->max_speed = avi->max_speed;
+ v->acceleration = avi->acceleration;
+ }
+ }
+ }
+
if (CheckSavegameVersion(49)) FOR_ALL_PLAYERS(p) p->face = ConvertFromOldPlayerFace(p->face);
return true;