chaos scroll fix
The intention of the rand method is to return a pseudorandom uniformly distributed int between lbound and ubound (both inclusive). The previous implementation did not work as intended when the lower bound was negative since java round up instead of down when casting a negative double to an int. Adding the lower bound after the cast rather than before fixes this. Also changed the CHSCROLL_STAT_RANGE from 6 to 5 to be consistent with gms.
This commit is contained in:
@@ -35,6 +35,6 @@ public class Randomizer {
|
||||
}
|
||||
|
||||
public static int rand(final int lbound, final int ubound) {
|
||||
return (int) ((rand.nextDouble() * (ubound - lbound + 1)) + lbound);
|
||||
return ((int) (rand.nextDouble() * (ubound - lbound + 1))) + lbound;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user