mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Attempting to fix IndexOutOfBoundsError in CostRemoveAnyCounter. Couldn't trace it to the root of the problem yet though.
This commit is contained in:
@@ -18,14 +18,11 @@
|
|||||||
package forge.game.cost;
|
package forge.game.cost;
|
||||||
|
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.*;
|
||||||
import forge.game.card.CardCollectionView;
|
|
||||||
import forge.game.card.CardLists;
|
|
||||||
import forge.game.card.CardPredicates;
|
|
||||||
import forge.game.card.CounterType;
|
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
import forge.util.TextUtil;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -135,6 +132,10 @@ public class CostRemoveAnyCounter extends CostPartWithList {
|
|||||||
if (c == null) {
|
if (c == null) {
|
||||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||||
}
|
}
|
||||||
|
if (decision.cards.isEmpty()) {
|
||||||
|
System.err.println(TextUtil.concatWithSpace("Warning: payment decision array was empty when paying CostRemoveAnyCounter for" + ability));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Card valid = decision.cards.get(0);
|
Card valid = decision.cards.get(0);
|
||||||
counterType = decision.ct;
|
counterType = decision.ct;
|
||||||
for (int i = 0; i < c; i++) {
|
for (int i = 0; i < c; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user