From e8ee9b70f088a63aaabd234ea56597372a24310a Mon Sep 17 00:00:00 2001 From: "ludwig.hirth" Date: Thu, 14 Nov 2013 15:52:27 +0100 Subject: [PATCH] Fixed handling of controlling player for asThough cast abilities (hope this will fix #363). --- Mage/src/mage/players/PlayerImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index d045cb2ef78..f1b010a4184 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -920,9 +920,11 @@ public abstract class PlayerImpl> implements Player, Ser } if (zone != Zone.HAND) { if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.CAST, game)) { - for (ActivatedAbility ability: object.getAbilities().getActivatedAbilities(Zone.HAND)) { + for (Ability ability: object.getAbilities()) { ability.setControllerId(this.getId()); - useable.put(ability.getId(), ability); + if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND)) { + useable.put(ability.getId(), (ActivatedAbility) ability); + } } } } @@ -1755,8 +1757,9 @@ public abstract class PlayerImpl> implements Player, Ser for (ExileZone exile: game.getExile().getExileZones()) { for (Card card: exile.getCards(game)) { if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.CAST, game)) { - for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.HAND)) { - if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) { + for (Ability ability: card.getAbilities()) { + ability.setControllerId(this.getId()); // controller must be set for case owner != caster + if (ability.getZone().match(Zone.HAND) && (ability instanceof SpellAbility || ability instanceof PlayLandAbility)) { playable.add(ability); } }