mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Removed potential integer overflow.
If the number passed into max is Integer.MAX_VALUE, like it is with ChoiceOfDamnation, the random number will overflow. So let's not do that.
This commit is contained in:
parent
4a9eddb724
commit
2ecb415b4d
1 changed files with 1 additions and 1 deletions
|
@ -1543,7 +1543,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
//TODO: improve this
|
||||
if (min < max && min == 0) {
|
||||
return RandomUtil.nextInt(max + 1);
|
||||
return RandomUtil.nextInt(max);
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue