Browse Source

fixed a bug in randHash... it was potentially returning an invalid number

Jason Persampieri 21 years ago
parent
commit
cf620b6396
1 changed files with 1 additions and 1 deletions
  1. 1 1
      direct/src/showbase/RandomNumGen.py

+ 1 - 1
direct/src/showbase/RandomNumGen.py

@@ -10,7 +10,7 @@ def randHash(num):
     bit patterns (i.e. doIds or zoneIds) to numbers with random bit patterns
     """
     rng = RandomNumGen(num)
-    return rng.randint(0,1<<16)
+    return rng.randint(0, (1<<16) - 1)
 
 class RandomNumGen:
     notify = \