Drain Power while loop logic fix

This commit is contained in:
L_J 2018-04-28 13:59:28 +00:00 committed by GitHub
parent d83af8be91
commit 97606fc50d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,7 +101,7 @@ class DrainPowerEffect extends OneShotEffect {
List<Permanent> ignorePermanents = new ArrayList<>();
TargetPermanent target = null;
do {
while (true) {
Map<Permanent, List<ActivatedManaAbilityImpl>> manaAbilitiesMap = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, targetPlayer.getId(), game)) {
if (!ignorePermanents.contains(permanent)) {
@ -162,7 +162,7 @@ class DrainPowerEffect extends OneShotEffect {
}
}
}
} while (target != null && target.canChoose(targetPlayer.getId(), game));
}
// 106.12. One card (Drain Power) causes one player to lose unspent mana and another to add the mana lost this way. (Note that these may be the same player.)
// This empties the former players mana pool and causes the mana emptied this way to be put into the latter players mana pool. Which permanents, spells, and/or