summaryrefslogtreecommitdiff
blob: 4ac1b101dc8cf3316a4ea1e319adc46c58b3dec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- zangband/src/z-rand.c
+++ zangband/src/z-rand.c
@@ -168,7 +168,7 @@
 			r = (Rand_state[j] += Rand_state[Rand_place]);
 
 			/* Hack -- extract a 28-bit "random" number */
-			r = (r >> 4) / n;
+			r = ((r >> 4) & 0x0FFFFFFF) / n;
 
 			/* Advance the index */
 			Rand_place = j;