Changeset - r8575:68e9cd8ed4a9
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-02-16 00:46:38
smatz@openttd.org
(svn r12156) -Fix (r11454): Chance16I was now biased towards zero - round to nearest now
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/core/random_func.hpp
Show inline comments
 
@@ -88,7 +88,7 @@ static inline uint32 InteractiveRandomRa
 
static inline bool Chance16I(const uint a, const uint b, const uint32 r)
 
{
 
	assert(b != 0);
 
	return (uint16)r < (uint16)((a << 16) / b);
 
	return (uint16)r < (uint16)(((a << 16) + b / 2) / b);
 
}
 

	
 
/**
0 comments (0 inline, 0 general)