fix AI crash when minimum cards to discard exceeds than the valid cards

reported here: https://discord.com/channels/267367946135928833/1291545865814675578/1291545865814675578
This commit is contained in:
kevlahnota
2024-10-04 15:45:11 +08:00
committed by GitHub
parent fea8855e0e
commit 5affe7dd23

View File

@@ -1034,8 +1034,8 @@ public class AiController {
}
public CardCollection getCardsToDiscard(int min, final int max, final CardCollection validCards, final SpellAbility sa) {
if (validCards.size() < min) {
return null;
if (validCards.size() <= min) {
return validCards; //return all valid cards since they will be discarded without filtering needed
}
Card sourceCard = null;