diff src/engine.cpp @ 10969:208ba3fba382 draft

(svn r15308) -Codechange: Deduplicate km-ish/h -> mph conversions.
author frosch <frosch@openttd.org>
date Sun, 01 Feb 2009 17:14:39 +0000
parents 57269a8c0b6d
children bb1fbf9e52ab
line wrap: on
line diff
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -156,22 +156,22 @@
 
 /**
  * Returns max speed for display purposes
- * @return max speed in mph
+ * @return max speed in km-ish/h
  */
 uint Engine::GetDisplayMaxSpeed() const
 {
 	switch (this->type) {
 		case VEH_TRAIN:
-			return GetEngineProperty(this->index, 0x09, this->u.rail.max_speed) * 10 / 16;
+			return GetEngineProperty(this->index, 0x09, this->u.rail.max_speed);
 
 		case VEH_ROAD:
-			return this->u.road.max_speed * 10 / 32;
+			return this->u.road.max_speed / 2;
 
 		case VEH_SHIP:
-			return GetEngineProperty(this->index, 0x0B, this->u.ship.max_speed) * 10 / 32;
+			return GetEngineProperty(this->index, 0x0B, this->u.ship.max_speed) / 2;
 
 		case VEH_AIRCRAFT:
-			return this->u.air.max_speed * 10 / 16;
+			return this->u.air.max_speed;
 
 		default: NOT_REACHED();
 	}