mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user