mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Reverting r32912 for now, more investigation needed.
This commit is contained in:
@@ -973,8 +973,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
final GameEntity oldEnchanted = c.getEnchanting();
|
||||
c.removeEnchanting(oldEnchanted);
|
||||
}
|
||||
if (!c.canBeEnchantedBy(attachedTo))
|
||||
{
|
||||
if (!checkCanAttachTo(c, attachedTo)) {
|
||||
// if an aura can't enchant the source, it shouldn't move (303.4i, 303.4j)
|
||||
continue;
|
||||
}
|
||||
@@ -1193,4 +1192,19 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkCanAttachTo(final Card source, final Card target) {
|
||||
final SpellAbility attachEff = source.getFirstAttachSpell();
|
||||
|
||||
if (attachEff == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Game game = source.getGame();
|
||||
final TargetRestrictions tgt = attachEff.getTargetRestrictions();
|
||||
|
||||
CardCollectionView list = game.getCardsIn(tgt.getZone());
|
||||
list = CardLists.getValidCards(list, tgt.getValidTgts(), attachEff.getActivatingPlayer(), source, attachEff);
|
||||
return list.contains(target);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user