From 25f70b8ae401df317962193c42930672520aa9e5 Mon Sep 17 00:00:00 2001
From: martin <me@martials.no>
Date: Sun, 27 Aug 2023 12:13:45 +0200
Subject: [PATCH] Fixed bug showing game as Closed when disconnecting

---
 pac-man-board-game/Services/Game.cs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pac-man-board-game/Services/Game.cs b/pac-man-board-game/Services/Game.cs
index 0cc5186..16ed112 100644
--- a/pac-man-board-game/Services/Game.cs
+++ b/pac-man-board-game/Services/Game.cs
@@ -37,8 +37,7 @@ public class Game
 
     [JsonInclude] public int Count => Players.Count;
 
-    [JsonInclude]
-    public bool IsGameStarted => Count > 0 && Players.All(player => player.State is State.InGame or State.Disconnected);
+    [JsonInclude] public bool IsGameStarted => Count > 0 && Players.Any(player => player.State is State.InGame);
 
     public Player NextPlayer()
     {
@@ -48,7 +47,7 @@ public class Game
         }
         catch (DivideByZeroException)
         {
-            throw new InvalidOperationException("There are no players in the game group.");
+            throw new InvalidOperationException("There are no players in the game.");
         }
 
         return Players[_currentPlayerIndex];