- Fixed possible NPE in checkETBEffects caused by getPossibleETBCounters.

This commit is contained in:
Sloth
2013-03-15 12:22:58 +00:00
parent ea4b9840f4
commit c783b32230
2 changed files with 2 additions and 9 deletions

View File

@@ -387,15 +387,11 @@ public class SpellPermanent extends Spell {
return super.canPlayAI();
}
public static boolean checkETBEffects(final Card card, final SpellAbility sa, final ApiType api) {
return checkETBEffects(card, sa, api, null);
}
public static boolean checkETBEffects(final Card card, final AIPlayer ai) {
return checkETBEffects(card, null, null, ai);
}
private static boolean checkETBEffects(final Card card, final SpellAbility sa, final ApiType api, final AIPlayer ai) {
public static boolean checkETBEffects(final Card card, final SpellAbility sa, final ApiType api, final AIPlayer ai) {
boolean rightapi = false;
if (card.isCreature()

View File

@@ -145,11 +145,8 @@ public class AiController {
for (final Card c : all) {
for (final SpellAbility sa : c.getNonManaSpellAbilities()) {
if (sa instanceof SpellPermanent) {
// TODO ArsenalNut (13 Oct 2012) added line to set activating player to fix NPE problem
// in checkETBEffects. There is SpellPermanent.checkETBEffects where the player can be
// directly input but it is currently a private method.
sa.setActivatingPlayer(player);
if (SpellPermanent.checkETBEffects(c, sa, ApiType.Counter)) {
if (SpellPermanent.checkETBEffects(c, sa, ApiType.Counter, player)) {
spellAbilities.add(sa);
}
}