mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Fix an issue with Retribution of the Ancients causing a NPE when X=0.
This commit is contained in:
@@ -898,6 +898,10 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getDistibutedCounters() {
|
private int getDistibutedCounters() {
|
||||||
|
if (cardsChosen == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (final Entry<Card, Integer> kv : cardsChosen.entrySet()) {
|
for (final Entry<Card, Integer> kv : cardsChosen.entrySet()) {
|
||||||
sum += kv.getValue().intValue();
|
sum += kv.getValue().intValue();
|
||||||
@@ -965,6 +969,10 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
|||||||
|
|
||||||
final CardCollectionView validCards = CardLists.getValidCards(player.getCardsIn(cost.zone), type.split(";"), player, source);
|
final CardCollectionView validCards = CardLists.getValidCards(player.getCardsIn(cost.zone), type.split(";"), player, source);
|
||||||
if (cost.zone.equals(ZoneType.Battlefield)) {
|
if (cost.zone.equals(ZoneType.Battlefield)) {
|
||||||
|
if (cntRemoved == 0) {
|
||||||
|
return PaymentDecision.card(source, 0);
|
||||||
|
}
|
||||||
|
|
||||||
final InputSelectCardToRemoveCounter inp = new InputSelectCardToRemoveCounter(controller, cntRemoved, cost.counter, validCards);
|
final InputSelectCardToRemoveCounter inp = new InputSelectCardToRemoveCounter(controller, cntRemoved, cost.counter, validCards);
|
||||||
inp.setMessage("Remove %d " + cost.counter.getName() + " counters from " + cost.getDescriptiveType());
|
inp.setMessage("Remove %d " + cost.counter.getName() + " counters from " + cost.getDescriptiveType());
|
||||||
inp.setCancelAllowed(true);
|
inp.setCancelAllowed(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user