* Vampire Hexmage - Fixed possible ConcurrentModificationException.
@@ -93,18 +93,13 @@ class VampireHexmageEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- TargetPermanent target = (TargetPermanent)source.getTargets().get(0);
-
- Permanent permanent = game.getPermanent(target.getFirstTarget());
-
+ Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
- for(Counter counter : permanent.getCounters(game).values()){
+ for (Counter counter : permanent.getCounters(game).copy().values()) { // copy to prevent ConcurrentModificationException
permanent.removeCounters(counter, game);
}
-
return true;
}
-
return false;
}
