summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-17 11:49:25 +0000
committerfrosch <frosch@openttd.org>2010-04-17 11:49:25 +0000
commit184fa43df2e14c73162e641bc9bc83e403f069ed (patch)
treed24d525121ba0120bd172975ee2e0784035f7128 /bin
parentcd20724d201b5b04c8dfac49b6b885ea988165ed (diff)
downloadopenttd-184fa43df2e14c73162e641bc9bc83e403f069ed.tar.xz
(svn r19652) -Fix: RandomRange() is used for bigger ranges in many cases, so generally extent it to handle 32 bits.
Diffstat (limited to 'bin')
-rw-r--r--bin/ai/regression/regression.nut6
-rw-r--r--bin/ai/regression/regression.txt8
2 files changed, 7 insertions, 7 deletions
diff --git a/bin/ai/regression/regression.nut b/bin/ai/regression/regression.nut
index 5f835c528..8891ca090 100644
--- a/bin/ai/regression/regression.nut
+++ b/bin/ai/regression/regression.nut
@@ -192,9 +192,9 @@ function Regression::Base()
print(" RandRange(2): " + AIBase.RandRange(2));
print(" RandRange(2): " + AIBase.RandRange(2));
print(" RandRange(2): " + AIBase.RandRange(2));
- print(" RandRange(9): " + AIBase.RandRange(9));
- print(" RandRange(9): " + AIBase.RandRange(9));
- print(" RandRange(9): " + AIBase.RandRange(9));
+ print(" RandRange(1000000): " + AIBase.RandRange(1000000)); // 32 bit tests
+ print(" RandRange(1000000): " + AIBase.RandRange(1000000));
+ print(" RandRange(1000000): " + AIBase.RandRange(1000000));
print(" Chance(1, 2): " + AIBase.Chance(1, 2));
print(" Chance(1, 2): " + AIBase.Chance(1, 2));
print(" Chance(1, 2): " + AIBase.Chance(1, 2));
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index 611450f46..effd50a78 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -96,10 +96,10 @@
RandRange(1): 0
RandRange(2): 0
RandRange(2): 0
- RandRange(2): 1
- RandRange(9): 6
- RandRange(9): 7
- RandRange(9): 4
+ RandRange(2): 0
+ RandRange(1000000): 987346
+ RandRange(1000000): 781750
+ RandRange(1000000): 191841
Chance(1, 2): true
Chance(1, 2): false
Chance(1, 2): false