gameServer/Actions.hs
changeset 2245 c011aecc95e5
parent 2172 80d34c0b9dfe
child 2337 723f1cbe2ef3
--- a/gameServer/Actions.hs	Thu Jul 09 00:56:26 2009 +0000
+++ b/gameServer/Actions.hs	Thu Jul 09 14:36:41 2009 +0000
@@ -178,7 +178,7 @@
 	processAction (
 		clID,
 		serverInfo,
-		adjust (\cl -> cl{roomID = rID}) clID clients,
+		adjust (\cl -> cl{roomID = rID, teamsInGame = if rID == 0 then teamsInGame cl else 0}) clID clients,
 		adjust (\r -> r{playersIDs = IntSet.insert clID (playersIDs r), playersIn = (playersIn r) + 1}) rID $
 			adjust (\r -> r{playersIDs = IntSet.delete clID (playersIDs r)}) 0 rooms
 		) joinMsg
@@ -204,7 +204,7 @@
 	return (
 		clID,
 		serverInfo,
-		adjust (\cl -> cl{roomID = 0, isMaster = False, isReady = False}) clID newClients,
+		adjust (\cl -> cl{roomID = 0, isMaster = False, isReady = False, teamsInGame = undefined}) clID newClients,
 		adjust (\r -> r{
 				playersIDs = IntSet.delete clID (playersIDs r),
 				playersIn = (playersIn r) - 1,
@@ -244,7 +244,7 @@
 	processAction (clID, serverInfo, clients, rooms) $ AnswerOthersInRoom ["ROOMABANDONED", name room]
 	return (clID,
 		serverInfo,
-		Data.IntMap.map (\cl -> if roomID cl == rID then cl{roomID = 0, isMaster = False, isReady = False} else cl) clients,
+		Data.IntMap.map (\cl -> if roomID cl == rID then cl{roomID = 0, isMaster = False, isReady = False, teamsInGame = undefined} else cl) clients,
 		delete rID $ adjust (\r -> r{playersIDs = IntSet.union (playersIDs room) (playersIDs r)}) 0 rooms
 		)
 	where