summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-02-01 17:14:39 +0000
committerfrosch <frosch@openttd.org>2009-02-01 17:14:39 +0000
commitde9a6fc90b4360313d8846c7701848b7a0295ba3 (patch)
treec6c194df7208fda252250f6a43df63be15b1bd2d /src/ai
parent317220c2e4f9d0866553635872cae952616169dc (diff)
downloadopenttd-de9a6fc90b4360313d8846c7701848b7a0295ba3.tar.xz
(svn r15308) -Codechange: Deduplicate km-ish/h -> mph conversions.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_bridge.cpp2
-rw-r--r--src/ai/api/ai_engine.cpp2
-rw-r--r--src/ai/api/ai_event_types.cpp2
-rw-r--r--src/ai/api/ai_vehicle.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_bridge.cpp b/src/ai/api/ai_bridge.cpp
index 310c23f25..f342404cf 100644
--- a/src/ai/api/ai_bridge.cpp
+++ b/src/ai/api/ai_bridge.cpp
@@ -133,7 +133,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{
if (!IsValidBridge(bridge_id)) return -1;
- return ::GetBridgeSpec(bridge_id)->speed;
+ return ::GetBridgeSpec(bridge_id)->speed; // km-ish/h
}
/* static */ Money AIBridge::GetPrice(BridgeID bridge_id, uint length)
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp
index 762da14b1..8c81862ad 100644
--- a/src/ai/api/ai_engine.cpp
+++ b/src/ai/api/ai_engine.cpp
@@ -119,7 +119,7 @@
if (!IsValidEngine(engine_id)) return -1;
const Engine *e = ::GetEngine(engine_id);
- int32 max_speed = e->GetDisplayMaxSpeed() * 16 / 10; // convert mph to km-ish/h
+ int32 max_speed = e->GetDisplayMaxSpeed(); // km-ish/h
if (e->type == VEH_AIRCRAFT) max_speed /= _settings_game.vehicle.plane_speed;
return max_speed;
}
diff --git a/src/ai/api/ai_event_types.cpp b/src/ai/api/ai_event_types.cpp
index c495e082e..abff79873 100644
--- a/src/ai/api/ai_event_types.cpp
+++ b/src/ai/api/ai_event_types.cpp
@@ -80,7 +80,7 @@ int32 AIEventEnginePreview::GetCapacity()
int32 AIEventEnginePreview::GetMaxSpeed()
{
const Engine *e = ::GetEngine(engine);
- int32 max_speed = e->GetDisplayMaxSpeed() * 16 / 10; // convert mph to km-ish/h
+ int32 max_speed = e->GetDisplayMaxSpeed(); // km-ish/h
if (e->type == VEH_AIRCRAFT) max_speed /= _settings_game.vehicle.plane_speed;
return max_speed;
}
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index 081b7b739..18e17221d 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -278,7 +278,7 @@
{
if (!IsValidVehicle(vehicle_id)) return -1;
- return ::GetVehicle(vehicle_id)->GetDisplaySpeed() * 16 / 10;
+ return ::GetVehicle(vehicle_id)->GetDisplaySpeed(); // km-ish/h
}
/* static */ AIVehicle::VehicleState AIVehicle::GetState(VehicleID vehicle_id)