* Prevented NPE for getPhaseType().

This commit is contained in:
LevelX2 2014-07-30 20:08:27 +02:00
parent f2fc548f08
commit 02df3f49a7
4 changed files with 5 additions and 5 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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);

View file

@ -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