gameServer/Actions.hs
changeset 1823 1938ef375350
parent 1813 cfe1481e0247
child 1827 3bb5e22b7f9a
--- a/gameServer/Actions.hs	Sat Feb 21 14:50:39 2009 +0000
+++ b/gameServer/Actions.hs	Sat Feb 21 19:59:03 2009 +0000
@@ -96,7 +96,11 @@
 			0,
 			serverInfo,
 			delete clID clients,
-			adjust (\r -> r{playersIDs = IntSet.delete clID (playersIDs r), playersIn = (playersIn r) - 1}) rID rooms
+			adjust (\r -> r{
+					playersIDs = IntSet.delete clID (playersIDs r),
+					playersIn = (playersIn r) - 1,
+					readyPlayers = if isReady client then readyPlayers r - 1 else readyPlayers r
+					}) rID rooms
 			)
 	where
 		client = clients ! clID
@@ -152,7 +156,11 @@
 		clID,
 		serverInfo,
 		adjust (\cl -> cl{roomID = 0}) clID clients,
-		adjust (\r -> r{playersIDs = IntSet.delete clID (playersIDs r), playersIn = (playersIn r) - 1}) rID $
+		adjust (\r -> r{
+				playersIDs = IntSet.delete clID (playersIDs r),
+				playersIn = (playersIn r) - 1,
+				readyPlayers = if isReady client then readyPlayers r - 1 else readyPlayers r
+				}) rID $
 			adjust (\r -> r{playersIDs = IntSet.insert clID (playersIDs r)}) 0 rooms
 		)
 	where