mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fix that cards that are cast using alternative cost effects keep their previous targets (#5189) - Always copy ability on cast.
This commit is contained in:
parent
22de85aee1
commit
e3a33e5894
1 changed files with 5 additions and 1 deletions
|
|
@ -1045,6 +1045,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
if (game == null || ability == null) {
|
if (game == null || ability == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use ability copy to avoid problems with targets and costs on recast (issue https://github.com/magefree/mage/issues/5189).
|
||||||
|
ability = ability.copy();
|
||||||
|
|
||||||
ability.setControllerId(getId());
|
ability.setControllerId(getId());
|
||||||
if (ability.getSpellAbilityType() != SpellAbilityType.BASE) {
|
if (ability.getSpellAbilityType() != SpellAbilityType.BASE) {
|
||||||
ability = chooseSpellAbilityForCast(ability, game, noMana);
|
ability = chooseSpellAbilityForCast(ability, game, noMana);
|
||||||
|
|
@ -1267,7 +1271,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
result = playManaAbility((ActivatedManaAbilityImpl) ability.copy(), game);
|
result = playManaAbility((ActivatedManaAbilityImpl) ability.copy(), game);
|
||||||
break;
|
break;
|
||||||
case SPELL:
|
case SPELL:
|
||||||
result = cast((SpellAbility) ability.copy(), game, false, activationStatus.getPermittingObject());
|
result = cast((SpellAbility) ability, game, false, activationStatus.getPermittingObject());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
result = playAbility(ability.copy(), game);
|
result = playAbility(ability.copy(), game);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue