mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
When copying spell-abilities to a new card, update the hostCard.
(Not sure what this affects, but noticed that it wasn't being done.)
This commit is contained in:
@@ -647,7 +647,7 @@ public class CardFactory {
|
||||
to.setReplacementEffects(fromCharacteristics.getReplacementEffects());
|
||||
// add abilities
|
||||
for (SpellAbility sa : fromCharacteristics.getIntrinsicSpellAbilities()) {
|
||||
to.addSpellAbility(sa.copy());
|
||||
to.addSpellAbility(sa.copy(to));
|
||||
}
|
||||
|
||||
for (String staticAbility : to.getStaticAbilityStrings()) {
|
||||
|
||||
@@ -755,11 +755,16 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
}
|
||||
|
||||
public SpellAbility copy() {
|
||||
return copy(hostCard);
|
||||
}
|
||||
|
||||
public SpellAbility copy(Card newHostCard) {
|
||||
SpellAbility clone = null;
|
||||
try {
|
||||
clone = (SpellAbility) clone();
|
||||
clone.id = nextId();
|
||||
clone.view = new SpellAbilityView(clone);
|
||||
clone.hostCard = newHostCard;
|
||||
if (clone.hostCard != null && clone.hostCard.getGame() != null) {
|
||||
clone.hostCard.getGame().addSpellAbility(clone.id, clone);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user