(svn r12310) [NoAI] -Fix: make MaxSpeed for Aircrafts return the value divided by plane_speed (which in regression is now set to 1/2th) noai
authortruebrain
Thu, 28 Feb 2008 12:31:49 +0000
branchnoai
changeset 9804 217f77b77400
parent 9803 c86d5834fb11
child 9805 d7f0e62cedf3
(svn r12310) [NoAI] -Fix: make MaxSpeed for Aircrafts return the value divided by plane_speed (which in regression is now set to 1/2th)
bin/ai/regression/regression.cfg
bin/ai/regression/regression.txt
src/ai/api/ai_engine.cpp
--- 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();