(svn r9158) [NoAI] -Fix: a 1 in 2 chance wasn't a 1 in two, but a 1 in 2 * 65536... noai
authorrubidium
Wed, 14 Mar 2007 01:58:36 +0000
branchnoai
changeset 9371 cfa43f975d01
parent 9370 839d87adee8e
child 9372 bd60b398f92b
(svn r9158) [NoAI] -Fix: a 1 in 2 chance wasn't a 1 in two, but a 1 in 2 * 65536...
src/ai/core/base/random.cpp
--- a/src/ai/core/base/random.cpp	Wed Mar 14 01:57:10 2007 +0000
+++ b/src/ai/core/base/random.cpp	Wed Mar 14 01:58:36 2007 +0000
@@ -38,5 +38,5 @@
 
 bool AIBase::Chance(uint out, uint max)
 {
-	return this->Random() <= (uint16)((65536 * out) / max);
+	return (uint16)this->Random() <= (uint16)((65536 * out) / max);
 }