diff --git a/forge-game/src/main/java/forge/game/spellability/AbilityActivated.java b/forge-game/src/main/java/forge/game/spellability/AbilityActivated.java index 08d2338c772..66bc0359be1 100644 --- a/forge-game/src/main/java/forge/game/spellability/AbilityActivated.java +++ b/forge-game/src/main/java/forge/game/spellability/AbilityActivated.java @@ -123,6 +123,14 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S public boolean isPossible() { //consider activated abilities possible always and simply disable if not currently playable //the exception is to consider them not possible if there's a zone or activator restriction that's not met + + // FIXME: Something is potentially leading to hard-to-reproducing conditions where this method is getting called + // with no activator set for the SA. Most likely deserves a better fix in the future. + if (this.getActivatingPlayer() == null) { + this.setActivatingPlayer(this.getHostCard().getController()); + System.out.println(this.getHostCard().getName() + " Did not have activator set in AbilityActivated.isPossible"); + } + return this.getRestrictions().checkZoneRestrictions(this.getHostCard(), this) && this.getRestrictions().checkActivatorRestrictions(this.getHostCard(), this); } diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java index 5dbbe119960..e9cedc6000a 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java @@ -197,9 +197,6 @@ public class SpellAbilityRestriction extends SpellAbilityVariables { } Player activator = sa.getActivatingPlayer(); - if (activator == null) { - return true; - } Zone cardZone = activator.getGame().getZoneOf(c); if (cardZone == null || !cardZone.is(this.getZone())) {