mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +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) {
|
if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) {
|
||||||
|
for (Player player: state.getPlayers().values()) {
|
||||||
|
if (!player.hasLeft() && !player.hasLost()) {
|
||||||
|
player.won(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
state.endGame();
|
state.endGame();
|
||||||
endTime = new Date();
|
endTime = new Date();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1158,8 +1158,12 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
||||||
//20100423 - 800.6, 801.16
|
//20100423 - 800.6, 801.16
|
||||||
if (game.getPlayers().size() > 2) {
|
if (game.getPlayers().size() > 2) {
|
||||||
for (UUID opponentId: game.getOpponents(playerId)) {
|
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 {
|
else {
|
||||||
this.wins = true;
|
this.wins = true;
|
||||||
|
|
Loading…
Reference in a new issue