mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Restore old controllers for AI checks
This commit is contained in:
@@ -6476,6 +6476,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
|
|
||||||
final Collection<SpellAbility> toRemove = Lists.newArrayListWithCapacity(abilities.size());
|
final Collection<SpellAbility> toRemove = Lists.newArrayListWithCapacity(abilities.size());
|
||||||
for (final SpellAbility sa : abilities) {
|
for (final SpellAbility sa : abilities) {
|
||||||
|
Player oldController = sa.getActivatingPlayer();
|
||||||
sa.setActivatingPlayer(player);
|
sa.setActivatingPlayer(player);
|
||||||
// fix things like retrace
|
// fix things like retrace
|
||||||
// check only if SA can't be cast normally
|
// check only if SA can't be cast normally
|
||||||
@@ -6483,6 +6484,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((removeUnplayable && !sa.canPlay()) || !sa.isPossible()) {
|
if ((removeUnplayable && !sa.canPlay()) || !sa.isPossible()) {
|
||||||
|
if (oldController != null) {
|
||||||
|
// in case the ability is on the stack this should not change
|
||||||
|
sa.setActivatingPlayer(oldController);
|
||||||
|
}
|
||||||
toRemove.add(sa);
|
toRemove.add(sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user