aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch/epfl/xblast/server/GameState.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java
index 2797e41..6ff0ded 100644
--- a/src/ch/epfl/xblast/server/GameState.java
+++ b/src/ch/epfl/xblast/server/GameState.java
@@ -425,7 +425,7 @@ public final class GameState {
425 * @return true if all the players are dead or if the game reached the time limit 425 * @return true if all the players are dead or if the game reached the time limit
426 */ 426 */
427 public boolean isGameOver() { 427 public boolean isGameOver() {
428 return this.alivePlayers().isEmpty() || this.ticks >= Ticks.TOTAL_TICKS; 428 return this.alivePlayers().size() <= this.players().size() - 1 || this.ticks >= Ticks.TOTAL_TICKS;
429 } 429 }
430 430
431 /** 431 /**
@@ -443,8 +443,8 @@ public final class GameState {
443 * @return the ID of the player who won the game. 443 * @return the ID of the player who won the game.
444 */ 444 */
445 public Optional<PlayerID> winner() { 445 public Optional<PlayerID> winner() {
446 if (this.players.size() == 1 && this.ticks < Ticks.TOTAL_TICKS) 446 if (this.alivePlayers().size() == 1)
447 return Optional.of(this.players.get(0).id()); 447 return Optional.of(this.alivePlayers().get(0).id());
448 else 448 else
449 return Optional.empty(); 449 return Optional.empty();
450 } 450 }