mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Save and restore controller ID in cardPlayableAbilities.
This commit is contained in:
parent
fbc88f152e
commit
b17bf1ac9f
1 changed files with 3 additions and 1 deletions
|
@ -3219,8 +3219,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
List<Ability> playable = new ArrayList();
|
||||
if (card != null) {
|
||||
for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) {
|
||||
UUID savedControllerId = null;
|
||||
if (setControllerId) {
|
||||
// For when owner != caster, e.g. with Psychic Intrusion and similar effects.
|
||||
savedControllerId = getId();
|
||||
ability.setControllerId(getId());
|
||||
}
|
||||
if (ability instanceof SpellAbility
|
||||
|
@ -3233,7 +3235,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
playable.add(ability);
|
||||
}
|
||||
if (setControllerId) {
|
||||
ability.setControllerId(card.getOwnerId());
|
||||
ability.setControllerId(savedControllerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue