mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
RepeatSubAbility host isn't set correctly if source changes zone
This commit is contained in:
@@ -28,11 +28,11 @@ public class RepeatEachEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
AbilitySub repeat = sa.getAdditionalAbility("RepeatSubAbility");
|
AbilitySub repeat = sa.getAdditionalAbility("RepeatSubAbility");
|
||||||
|
|
||||||
if (repeat != null && !repeat.getHostCard().equals(source)) {
|
if (repeat != null && !repeat.getHostCard().equalsWithTimestamp(source)) {
|
||||||
// TODO: for some reason, the host card of the original additional SA is set to the cloned card when
|
// TODO: for some reason, the host card of the original additional SA is set to the cloned card when
|
||||||
// the ability is copied (e.g. Clone Legion + Swarm Intelligence). Couldn't figure out why this happens,
|
// the ability is copied (e.g. Clone Legion + Swarm Intelligence). Couldn't figure out why this happens,
|
||||||
// so this hack is necessary for now to work around this issue.
|
// so this hack is necessary for now to work around this issue.
|
||||||
System.out.println("Warning: RepeatSubAbility had the wrong host set (potentially after cloning the root SA), attempting to correct...");
|
System.out.println("Warning: RepeatSubAbility had the wrong host set (potentially after cloning the root SA or changing zones), attempting to correct...");
|
||||||
repeat.setHostCard(source);
|
repeat.setHostCard(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4776,6 +4776,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
public final void setTimestamp(final long t) {
|
public final void setTimestamp(final long t) {
|
||||||
timestamp = t;
|
timestamp = t;
|
||||||
}
|
}
|
||||||
|
public boolean equalsWithTimestamp(Card c) {
|
||||||
|
return c == this && c.getTimestamp() == timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assign a random foil finish depending on the card edition.
|
* Assign a random foil finish depending on the card edition.
|
||||||
|
|||||||
Reference in New Issue
Block a user