* Fixed handling of "Duration.UntilYourNextTurn" in case the player left the game in multiplayer matches.

This commit is contained in:
LevelX2 2014-10-11 11:27:34 +02:00
parent ddf42c7620
commit d47dd0bb52

View file

@ -52,6 +52,7 @@ import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.players.Player;
/**
*
@ -183,7 +184,14 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
@Override
public boolean isInactive(Ability source, Game game) {
if (duration.equals(Duration.UntilYourNextTurn)) {
return game.getActivePlayerId().equals(startingControllerId) && game.getTurnNum() != startingTurn;
Player player = game.getPlayer(startingControllerId);
if (player != null) {
if (player.isInGame()) {
return game.getActivePlayerId().equals(startingControllerId) && game.getTurnNum() != startingTurn;
}
return player.hasReachedNextTurnAfterLeaving();
}
return true;
}
return false;
}