mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
* Fixed a problem of endless iteration with Reflecting Pool.
This commit is contained in:
parent
83cdd5570d
commit
d686af8890
4 changed files with 9 additions and 7 deletions
|
|
@ -206,13 +206,17 @@ class ReflectingPoolEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
private Mana getManaTypes(Game game, Ability source) {
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||
Mana types = new Mana();
|
||||
if (game == null || game.getPhase() == null) {
|
||||
return types;
|
||||
}
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent land : lands) {
|
||||
Abilities<Ability> manaAbilities = land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
|
||||
for (Ability basicAbility : manaAbilities) {
|
||||
ManaAbility ability = (ManaAbility) basicAbility;
|
||||
if (!ability.equals(source) && ability.definesMana(game)) {
|
||||
if (!(ability instanceof ReflectingPoolManaAbility) // can't get types from own ability class
|
||||
&& ability.definesMana(game)) {
|
||||
for (Mana netMana : ability.getNetMana(game)) {
|
||||
types.add(netMana);
|
||||
if (netMana.getAny() > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue