mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fixed possible IndexOutOfBoundsException in chooseCardsToRevealFromHand.
This commit is contained in:
@@ -347,7 +347,8 @@ public class PlayerControllerAi extends PlayerController {
|
||||
|
||||
@Override
|
||||
public List<Card> chooseCardsToRevealFromHand(int min, int max, List<Card> valid) {
|
||||
return max == 0 ? Lists.<Card>newArrayList() : valid.subList(0, max);
|
||||
int numCardsToReveal = Math.min(max, valid.size());
|
||||
return numCardsToReveal == 0 ? Lists.<Card>newArrayList() : valid.subList(0, numCardsToReveal);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user