mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
Fixed some bugs causing null pointer or concurrent modification exceptions.
This commit is contained in:
parent
0cb92e6936
commit
b3eb6f536a
4 changed files with 15 additions and 16 deletions
|
|
@ -51,7 +51,6 @@ import mage.target.Target;
|
|||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -70,9 +69,6 @@ public class AwakenAbility extends SpellAbility {
|
|||
this.getEffects().addAll(card.getSpellAbility().getEffects().copy());
|
||||
this.getTargets().addAll(card.getSpellAbility().getTargets().copy());
|
||||
this.getChoices().addAll(card.getSpellAbility().getChoices().copy());
|
||||
for (Watcher watcher : card.getSpellAbility().getWatchers()) {
|
||||
this.getWatchers().add(watcher.copy());
|
||||
}
|
||||
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
|
||||
this.timing = card.getSpellAbility().getTiming();
|
||||
this.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent(filterMessage)));
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import mage.constants.SpellAbilityType;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -49,9 +48,6 @@ public class RetraceAbility extends SpellAbility {
|
|||
this.getEffects().addAll(card.getSpellAbility().getEffects().copy());
|
||||
this.getTargets().addAll(card.getSpellAbility().getTargets().copy());
|
||||
this.getChoices().addAll(card.getSpellAbility().getChoices().copy());
|
||||
for (Watcher watcher : card.getSpellAbility().getWatchers()) {
|
||||
this.getWatchers().add(watcher.copy());
|
||||
}
|
||||
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
|
||||
this.timing = card.getSpellAbility().getTiming();
|
||||
|
||||
|
|
|
|||
|
|
@ -169,10 +169,13 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
|
|||
@Override
|
||||
public Set<Card> getCards(FilterCard filter, UUID sourceId, UUID playerId, Game game) {
|
||||
Set<Card> cards = new LinkedHashSet<>();
|
||||
for (UUID card : this) {
|
||||
boolean match = filter.match(game.getCard(card), sourceId, playerId, game);
|
||||
if (match) {
|
||||
cards.add(game.getCard(card));
|
||||
for (UUID cardId : this) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
boolean match = filter.match(card, sourceId, playerId, game);
|
||||
if (match) {
|
||||
cards.add(game.getCard(cardId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return cards;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue