summaryrefslogtreecommitdiff
path: root/bin/ai/regression
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-03-08 19:52:22 +0100
committerPeterN <peter@fuzzle.org>2019-03-24 15:28:48 +0000
commitf8e6cd10ef8161fbaa95a847a794e475d6aeb60e (patch)
tree734b37097034e180161ec9a6b003c2c465d151f9 /bin/ai/regression
parentd54b6ac09b6fe88c09f7886739fe9c05f16b8222 (diff)
downloadopenttd-f8e6cd10ef8161fbaa95a847a794e475d6aeb60e.tar.xz
Add: script API functions for build with refit feature
Diffstat (limited to 'bin/ai/regression')
-rw-r--r--bin/ai/regression/tst_regression/main.nut13
-rw-r--r--bin/ai/regression/tst_regression/result.txt14
2 files changed, 26 insertions, 1 deletions
diff --git a/bin/ai/regression/tst_regression/main.nut b/bin/ai/regression/tst_regression/main.nut
index 7315f33f8..baece09d0 100644
--- a/bin/ai/regression/tst_regression/main.nut
+++ b/bin/ai/regression/tst_regression/main.nut
@@ -1704,6 +1704,19 @@ function Regression::Vehicle()
print(" GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17 3));
print(" GetWagonAge(): " + AIVehicle.GetWagonAge(17, 3));
+ print(" --Refit--");
+ print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 255));
+ print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 0));
+ print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 9));
+ print(" BuildVehicleWithRefit(): " + AIVehicle.BuildVehicleWithRefit(28479, 211, 9));
+ print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9));
+ print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5));
+ print(" GetRefitCapacity(): " + AIVehicle.GetRefitCapacity(20, 5));
+ print(" RefitVehicle(): " + AIVehicle.RefitVehicle(20, 5));
+ print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9));
+ print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5));
+ print(" SellVehicle(): " + AIVehicle.SellVehicle(20));
+
print(" --Errors--");
print(" RefitVehicle(): " + AIVehicle.RefitVehicle(12, 0));
print(" GetLastErrorString(): " + AIError.GetLastErrorString());
diff --git a/bin/ai/regression/tst_regression/result.txt b/bin/ai/regression/tst_regression/result.txt
index e93b2e234..cda888d29 100644
--- a/bin/ai/regression/tst_regression/result.txt
+++ b/bin/ai/regression/tst_regression/result.txt
@@ -9128,6 +9128,18 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetWagonAge(): 0
GetWagonEngineType(): 65535
GetWagonAge(): -1
+ --Refit--
+ GetBuildWithRefitCapacity(): -1
+ GetBuildWithRefitCapacity(): 0
+ GetBuildWithRefitCapacity(): 160
+ BuildVehicleWithRefit(): 20
+ GetCapacity(): 160
+ GetCapacity(): 0
+ GetRefitCapacity(): 160
+ RefitVehicle(): true
+ GetCapacity(): 0
+ GetCapacity(): 160
+ SellVehicle(): true
--Errors--
RefitVehicle(): false
GetLastErrorString(): ERR_VEHICLE_NOT_IN_DEPOT
@@ -9175,7 +9187,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
13 => 5489
12 => 5489
CurrentSpeed ListDump:
- 12 => 21
+ 12 => 27
17 => 0
16 => 0
14 => 0