mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fixed a bug that Free For All multiplayer games were never finished because no player got wins. Only losses were set.
This commit is contained in:
parent
6e696c57ec
commit
fe051b5d29
2 changed files with 10 additions and 1 deletions
|
@ -392,6 +392,11 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
}
|
||||
}
|
||||
if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) {
|
||||
for (Player player: state.getPlayers().values()) {
|
||||
if (!player.hasLeft() && !player.hasLost()) {
|
||||
player.won(this);
|
||||
}
|
||||
}
|
||||
state.endGame();
|
||||
endTime = new Date();
|
||||
return true;
|
||||
|
|
|
@ -1158,8 +1158,12 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
//20100423 - 800.6, 801.16
|
||||
if (game.getPlayers().size() > 2) {
|
||||
for (UUID opponentId: game.getOpponents(playerId)) {
|
||||
game.getPlayer(opponentId).lost(game);
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (!opponent.hasLost()) {
|
||||
game.getPlayer(opponentId).lost(game);
|
||||
}
|
||||
}
|
||||
this.wins = true;
|
||||
}
|
||||
else {
|
||||
this.wins = true;
|
||||
|
|
Loading…
Reference in a new issue