From f621608f7d142993b3185bc98c31c814455c519c Mon Sep 17 00:00:00 2001 From: celestar Date: Fri, 2 Mar 2007 12:01:24 +0000 Subject: (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. --- src/openttd.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/openttd.cpp') 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; -- cgit v1.2.3-54-g00ecf