From 3171f0d3a98a6a783e7c8480b34fced39e6335db Mon Sep 17 00:00:00 2001 From: jje4th Date: Thu, 7 Apr 2016 04:36:36 +0000 Subject: [PATCH] Fix NullRef in TokenAi - one of the checks assumes the token is a creature which causes a NullRef on Clue Tokens. Added null checks. Fix for "SubAbility not found for: Liliana's Indignation (109)" --- forge-ai/src/main/java/forge/ai/ability/TokenAi.java | 2 +- forge-gui/res/cardsfolder/l/lilianas_indignation.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/TokenAi.java b/forge-ai/src/main/java/forge/ai/ability/TokenAi.java index 46f7aa36702..34a47655303 100644 --- a/forge-ai/src/main/java/forge/ai/ability/TokenAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/TokenAi.java @@ -250,7 +250,7 @@ public class TokenAi extends SpellAbilityAi { } } - if (this.tokenAmount.equals("X") || this.tokenPower.equals("X") || this.tokenToughness.equals("X")) { + if (this.tokenAmount.equals("X") || (this.tokenPower != null && this.tokenPower.equals("X")) || (this.tokenToughness != null && this.tokenToughness.equals("X"))) { int x = AbilityUtils.calculateAmount(sa.getHostCard(), this.tokenAmount, sa); if (source.getSVar("X").equals("Count$Converge")) { x = ComputerUtilMana.getConvergeCount(sa, ai); diff --git a/forge-gui/res/cardsfolder/l/lilianas_indignation.txt b/forge-gui/res/cardsfolder/l/lilianas_indignation.txt index d4402eb4240..18b881c279f 100644 --- a/forge-gui/res/cardsfolder/l/lilianas_indignation.txt +++ b/forge-gui/res/cardsfolder/l/lilianas_indignation.txt @@ -2,7 +2,7 @@ Name:Liliana's Indignation ManaCost:X B Types:Sorcery A:SP$ Mill | Cost$ X B | NumCards$ X | References$ X | Defined$ You | RememberMilled$ True | SubAbility$ DBLoseLife | SpellDescription$ Put the top X cards of your library into your graveyard. Target player loses 2 life for each creature card put into the graveyard this way. -SVar:DBLoseLife:DB$LoseLife | ValidTgts$ Player | TgtPrompt$ Select a player | LifeAmount$ Y | References$ Y | SubAbility$ Cleanup +SVar:DBLoseLife:DB$LoseLife | ValidTgts$ Player | TgtPrompt$ Select a player | LifeAmount$ Y | References$ Y | SubAbility$ DBCleanup SVar:X:Count$xPaid SVar:Y:Count$ValidGraveyard Creature.IsRemembered/Times.2 SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True