mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08: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();
|
List<Ability> playable = new ArrayList();
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) {
|
for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) {
|
||||||
|
UUID savedControllerId = null;
|
||||||
if (setControllerId) {
|
if (setControllerId) {
|
||||||
// For when owner != caster, e.g. with Psychic Intrusion and similar effects.
|
// For when owner != caster, e.g. with Psychic Intrusion and similar effects.
|
||||||
|
savedControllerId = getId();
|
||||||
ability.setControllerId(getId());
|
ability.setControllerId(getId());
|
||||||
}
|
}
|
||||||
if (ability instanceof SpellAbility
|
if (ability instanceof SpellAbility
|
||||||
|
|
@ -3233,7 +3235,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
playable.add(ability);
|
playable.add(ability);
|
||||||
}
|
}
|
||||||
if (setControllerId) {
|
if (setControllerId) {
|
||||||
ability.setControllerId(card.getOwnerId());
|
ability.setControllerId(savedControllerId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue