Mercurial > hg > openttd
changeset 15511:fbbbb2791756 draft
(svn r20164) -Fix [FS#3870]: inconsistencies w.r.t. to km/h vs km-ish/h as "base" unit for aircraft speeds
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 16 Jul 2010 17:45:34 +0000 |
parents | a215a8588379 |
children | 9129648e0ffd |
files | bin/ai/regression/regression.txt src/aircraft_cmd.cpp src/economy.cpp src/engine.cpp src/newgrf.cpp src/saveload/afterload.cpp src/table/engines.h |
diffstat | 7 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/ai/regression/regression.txt +++ b/bin/ai/regression/regression.txt @@ -4998,7 +4998,7 @@ CanRefitCargo(): false GetCapacity(): 25 GetReliability(): 58 - GetMaxSpeed(): 238 + GetMaxSpeed(): 236 GetPrice(): 28710 GetMaxAge(): 7320 GetRunningCost(): 2390 @@ -5016,7 +5016,7 @@ CanRefitCargo(): false GetCapacity(): 65 GetReliability(): 95 - GetMaxSpeed(): 238 + GetMaxSpeed(): 236 GetPrice(): 30761 GetMaxAge(): 8784 GetRunningCost(): 2812 @@ -5070,7 +5070,7 @@ CanRefitCargo(): false GetCapacity(): 30 GetReliability(): 77 - GetMaxSpeed(): 238 + GetMaxSpeed(): 236 GetPrice(): 30761 GetMaxAge(): 10980 GetRunningCost(): 2756
--- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -663,8 +663,8 @@ { uint max_speed = GetVehicleProperty(v, PROP_AIRCRAFT_SPEED, 0); if (max_speed != 0) { - /* Convert from original units to (approx) km/h */ - max_speed = (max_speed * 129) / 10; + /* Convert from original units to km-ish/h */ + max_speed = (max_speed * 128) / 10; v->acache.cached_max_speed = max_speed; } else {
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -1241,7 +1241,7 @@ case VEH_TRAIN: t = Train::From(u)->tcache.cached_max_speed; break; case VEH_ROAD: t = u->max_speed / 2; break; case VEH_SHIP: t = u->max_speed; break; - case VEH_AIRCRAFT: t = u->max_speed * 10 / 129; break; // convert to old units + case VEH_AIRCRAFT: t = u->max_speed * 10 / 128; break; // convert to old units default: NOT_REACHED(); }
--- a/src/engine.cpp +++ b/src/engine.cpp @@ -293,7 +293,7 @@ case VEH_AIRCRAFT: { uint max_speed = GetEngineProperty(this->index, PROP_AIRCRAFT_SPEED, 0); if (max_speed != 0) { - return (max_speed * 129) / 10; + return (max_speed * 128) / 10; } return this->u.air.max_speed; }
--- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1034,12 +1034,12 @@ avi->cost_factor = buf->ReadByte(); break; - case PROP_AIRCRAFT_SPEED: // 0x0C Speed (1 unit is 8 mph, we translate to 1 unit is 1 km/h) - avi->max_speed = (buf->ReadByte() * 129) / 10; + case PROP_AIRCRAFT_SPEED: // 0x0C Speed (1 unit is 8 mph, we translate to 1 unit is 1 km-ish/h) + avi->max_speed = (buf->ReadByte() * 128) / 10; break; case 0x0D: // Acceleration - avi->acceleration = (buf->ReadByte() * 129) / 10; + avi->acceleration = (buf->ReadByte() * 128) / 10; break; case PROP_AIRCRAFT_RUNNING_COST_FACTOR: // 0x0E Running cost factor
--- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1322,11 +1322,11 @@ if (CheckSavegameVersion(50)) { Aircraft *v; - /* Aircraft units changed from 8 mph to 1 km/h */ + /* Aircraft units changed from 8 mph to 1 km-ish/h */ FOR_ALL_AIRCRAFT(v) { if (v->subtype <= AIR_AIRCRAFT) { const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type); - v->cur_speed *= 129; + v->cur_speed *= 128; v->cur_speed /= 10; v->max_speed = avi->max_speed; v->acceleration = avi->acceleration;
--- a/src/table/engines.h +++ b/src/table/engines.h @@ -565,7 +565,7 @@ * @param h mail_capacity (bags) * @param i passenger_capacity (persons) */ -#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, (g * 129) / 10, h, i } +#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, (g * 128) / 10, h, i } #define H AIR_HELI #define P AIR_CTOL #define J AIR_CTOL | AIR_FAST