- Fixed chooseNumber crashing when min > max.

This commit is contained in:
Sloth
2014-12-21 08:28:22 +00:00
parent 8007750724
commit 1230e7cbcc

View File

@@ -430,6 +430,9 @@ public class PlayerControllerHuman extends PlayerController {
@Override @Override
public int chooseNumber(SpellAbility sa, String title, int min, int max) { public int chooseNumber(SpellAbility sa, String title, int min, int max) {
if (min >= max) {
return min;
}
final Integer[] choices = new Integer[max + 1 - min]; final Integer[] choices = new Integer[max + 1 - min];
for (int i = 0; i <= max - min; i++) { for (int i = 0; i <= max - min; i++) {
choices[i] = Integer.valueOf(i + min); choices[i] = Integer.valueOf(i + min);