(svn r12310) [NoAI] -Fix: make MaxSpeed for Aircrafts return the value divided by plane_speed (which in regression is now set to 1/2th)
--- a/bin/ai/regression/regression.cfg Thu Feb 28 01:11:23 2008 +0000
+++ b/bin/ai/regression/regression.cfg Thu Feb 28 12:31:49 2008 +0000
@@ -6,3 +6,6 @@
town_name = english
road_side = right
autosave = off
+
+[patches]
+plane_speed = 2
--- a/bin/ai/regression/regression.txt Thu Feb 28 01:11:23 2008 +0000
+++ b/bin/ai/regression/regression.txt Thu Feb 28 12:31:49 2008 +0000
@@ -3110,7 +3110,7 @@
GetCargoType(): 0
GetCapacity(): 25
GetReliability(): 70
- GetMaxSpeed(): 477
+ GetMaxSpeed(): 238
GetPrice(): 28710
GetMaxAge(): 7320
GetRunningCost(): 2390
@@ -3121,7 +3121,7 @@
GetCargoType(): 0
GetCapacity(): 65
GetReliability(): 95
- GetMaxSpeed(): 477
+ GetMaxSpeed(): 238
GetPrice(): 30761
GetMaxAge(): 8784
GetRunningCost(): 2812
@@ -3154,7 +3154,7 @@
GetCargoType(): 0
GetCapacity(): 30
GetReliability(): 76
- GetMaxSpeed(): 477
+ GetMaxSpeed(): 238
GetPrice(): 30761
GetMaxAge(): 10980
GetRunningCost(): 2756
--- a/src/ai/api/ai_engine.cpp Thu Feb 28 01:11:23 2008 +0000
+++ b/src/ai/api/ai_engine.cpp Thu Feb 28 12:31:49 2008 +0000
@@ -14,6 +14,7 @@
#include "../../core/alloc_func.hpp"
#include "../../economy_func.h"
#include "../../core/bitmath_func.hpp"
+#include "../../settings_type.h"
#include "table/strings.h"
/* static */ bool AIEngine::IsValidEngine(EngineID engine_id)
@@ -121,7 +122,7 @@
case VEH_AIRCRAFT: {
const AircraftVehicleInfo *vi = ::AircraftVehInfo(engine_id);
- return vi->max_speed;
+ return vi->max_speed / _patches.plane_speed;
} break;
default: NOT_REACHED();