From 02df3f49a79910eb37f87209f7c8b52c804c3668 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 30 Jul 2014 20:08:27 +0200 Subject: [PATCH] * Prevented NPE for getPhaseType(). --- Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java | 4 ++-- Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java | 2 +- Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java | 2 +- .../src/mage/abilities/condition/common/IsPhaseCondition.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java index 85dfdf8e1a..6210b02940 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java +++ b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java @@ -143,8 +143,8 @@ class FuryOfTheHordeAddPhasesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { // 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created. - if (game.getTurn().getPhaseType().equals(TurnPhase.PRECOMBAT_MAIN) - || game.getTurn().getPhaseType().equals(TurnPhase.POSTCOMBAT_MAIN) ) { + if (TurnPhase.PRECOMBAT_MAIN.equals(game.getTurn().getPhaseType()) + || TurnPhase.POSTCOMBAT_MAIN.equals(game.getTurn().getPhaseType()) ) { // we can't add two turn modes at once, will add additional post combat on delayed trigger resolution TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false); game.getState().getTurnMods().add(combat); diff --git a/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java b/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java index a6e9a88576..70e0f08f07 100644 --- a/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java +++ b/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java @@ -110,7 +110,7 @@ class SpinalEmbraceEffect extends ContinuousRuleModifiyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) { - return !game.getTurn().getPhaseType().equals(TurnPhase.COMBAT); + return !TurnPhase.COMBAT.equals(game.getTurn().getPhaseType()); } return false; } diff --git a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java index 2d0a90d4d8..034f48f18b 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java +++ b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java @@ -125,7 +125,7 @@ class RelentlessAssaultAddPhasesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { // 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created. - if (game.getTurn().getPhaseType().equals(TurnPhase.PRECOMBAT_MAIN) || game.getTurn().getPhaseType().equals(TurnPhase.POSTCOMBAT_MAIN)) { + if (TurnPhase.PRECOMBAT_MAIN.equals(game.getTurn().getPhaseType()) || TurnPhase.POSTCOMBAT_MAIN.equals(game.getTurn().getPhaseType())) { // we can't add two turn modes at once, will add additional post combat on delayed trigger resolution TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false); game.getState().getTurnMods().add(combat); diff --git a/Mage/src/mage/abilities/condition/common/IsPhaseCondition.java b/Mage/src/mage/abilities/condition/common/IsPhaseCondition.java index 3739a855f2..ea38137346 100644 --- a/Mage/src/mage/abilities/condition/common/IsPhaseCondition.java +++ b/Mage/src/mage/abilities/condition/common/IsPhaseCondition.java @@ -47,7 +47,7 @@ public class IsPhaseCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getTurn().getPhaseType().equals(turnPhase); + return turnPhase.equals(game.getTurn().getPhaseType()); } @Override