mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Vampire Hexmage - Fixed possible ConcurrentModificationException.
This commit is contained in:
parent
e7a3fee8d7
commit
58627bfcf6
1 changed files with 5 additions and 10 deletions
|
@ -51,7 +51,7 @@ import mage.target.TargetPermanent;
|
|||
public class VampireHexmage extends CardImpl {
|
||||
|
||||
public VampireHexmage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}");
|
||||
this.subtype.add("Vampire");
|
||||
this.subtype.add("Shaman");
|
||||
|
||||
|
@ -77,12 +77,12 @@ public class VampireHexmage extends CardImpl {
|
|||
|
||||
class VampireHexmageEffect extends OneShotEffect {
|
||||
|
||||
VampireHexmageEffect ( ) {
|
||||
VampireHexmageEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Remove all counters from target permanent";
|
||||
}
|
||||
|
||||
VampireHexmageEffect ( VampireHexmageEffect effect ) {
|
||||
VampireHexmageEffect(VampireHexmageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue