merge latest trunk

This commit is contained in:
myk
2013-03-15 17:19:13 +00:00
8 changed files with 8 additions and 94 deletions

View File

@@ -386,15 +386,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

@@ -144,11 +144,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);
}
}