From 2bfc5373fe9134b573e6b37d0c840d8b5ce3535c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jul 2013 00:37:37 +0200 Subject: [PATCH] Fixed a bug in tournament that eliminates opponent of player that quits e.g. in first game. --- Mage/src/mage/game/tournament/TournamentPairing.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/game/tournament/TournamentPairing.java b/Mage/src/mage/game/tournament/TournamentPairing.java index 34ca9c5cfe..9c9a4f651a 100644 --- a/Mage/src/mage/game/tournament/TournamentPairing.java +++ b/Mage/src/mage/game/tournament/TournamentPairing.java @@ -30,6 +30,7 @@ package mage.game.tournament; import java.util.UUID; import mage.game.match.Match; +import mage.game.match.MatchPlayer; /** * @@ -69,10 +70,12 @@ public class TournamentPairing { } public void eliminatePlayers() { - if (match.getPlayer(player1.getPlayer().getId()).getWins() < match.getWinsNeeded()) { + MatchPlayer mPlayer1 = match.getPlayer(player1.getPlayer().getId()); + MatchPlayer mPlayer2 = match.getPlayer(player2.getPlayer().getId()); + if (mPlayer1.hasQuit() || (!mPlayer2.hasQuit() && mPlayer1.getWins() < match.getWinsNeeded())) { player1.setEliminated(); } - if (match.getPlayer(player2.getPlayer().getId()).getWins() < match.getWinsNeeded()) { + if (mPlayer2.hasQuit() || (!mPlayer1.hasQuit() && mPlayer2.getWins() < match.getWinsNeeded())) { player2.setEliminated(); } }