Fix for colored mana producers only produce colorless mana (#432). Had to change logic to work properly. The mana will be copied before adding and replaced by mana pool.

This commit is contained in:
LevelX2 2014-08-29 09:57:35 +02:00
parent 153b87e664
commit 97a1b0130c
3 changed files with 2 additions and 6 deletions

View file

@ -112,7 +112,6 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
} }
mana.setWhite(0); mana.setWhite(0);
} }
((ManaEvent) event).setMana(mana);
return false; return false;
} }

View file

@ -48,8 +48,4 @@ public class ManaEvent extends GameEvent {
return mana; return mana;
} }
public void setMana(Mana mana) {
this.mana = mana;
}
} }

View file

@ -302,7 +302,8 @@ public class ManaPool implements Serializable {
return m; return m;
} }
public void addMana(Mana mana, Game game, Ability source) { public void addMana(Mana manaToAdd, Game game, Ability source) {
Mana mana = manaToAdd.copy();
if (!game.replaceEvent(new ManaEvent(EventType.ADD_MANA, source.getId(), source.getSourceId(), source.getControllerId(), mana))) { if (!game.replaceEvent(new ManaEvent(EventType.ADD_MANA, source.getId(), source.getSourceId(), source.getControllerId(), mana))) {
if (mana instanceof ConditionalMana) { if (mana instanceof ConditionalMana) {
this.manaItems.add(new ManaPoolItem((ConditionalMana)mana, source.getSourceId())); this.manaItems.add(new ManaPoolItem((ConditionalMana)mana, source.getSourceId()));