1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-01-10 13:07:17 +00:00

rng bugfix

This commit is contained in:
Alula 2021-02-12 23:48:42 +01:00
parent 1cc7ed8b2b
commit e4d35f3664
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -5,7 +5,7 @@ pub trait RNG {
fn next(&self) -> i32;
fn range(&self, range: Range<i32>) -> i32 {
range.start + ((self.next() & 0x7fffffff) % (range.len() as i32))
range.start + ((self.next() & 0x7fffffff) % (range.len() as i32 + 1))
}
}