mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Fixed possible source for NPE's in RemoveFromCombatEffect.
This commit is contained in:
@@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.SpellAbilityEffect;
|
import forge.game.ability.SpellAbilityEffect;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
import forge.game.combat.Combat;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.spellability.TargetRestrictions;
|
import forge.game.spellability.TargetRestrictions;
|
||||||
@@ -34,8 +35,9 @@ public class RemoveFromCombatEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||||
for (final Card c : getTargetCards(sa)) {
|
for (final Card c : getTargetCards(sa)) {
|
||||||
if ((tgt == null) || c.canBeTargetedBy(sa) && game.getPhaseHandler().inCombat()) {
|
final Combat combat = game.getPhaseHandler().getCombat();
|
||||||
game.getPhaseHandler().getCombat().removeFromCombat(c);
|
if (combat != null && (tgt == null || c.canBeTargetedBy(sa))) {
|
||||||
|
combat.removeFromCombat(c);
|
||||||
if (rem) {
|
if (rem) {
|
||||||
sa.getSourceCard().addRemembered(c);
|
sa.getSourceCard().addRemembered(c);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user