netserver/HWProto.hs
changeset 1675 d5e131005516
parent 1673 06bff12f8a74
child 1676 6f6f14a3e0ea
--- a/netserver/HWProto.hs	Wed Jan 14 19:31:23 2009 +0000
+++ b/netserver/HWProto.hs	Wed Jan 14 21:39:37 2009 +0000
@@ -243,7 +243,10 @@
 		(modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, (answerJoined $ nick client) ++ answerNicks ++ answerReady ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams (protocol client) clRoom ++ watchRound)
 	where
 		noSuchRoom = isNothing $ find (\room -> roomName == name room && roomProto room == protocol client) rooms
-		answerNicks = answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients)
+		answerNicks = if not $ null sameRoomClients then
+					answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients)
+				else
+					[]
 		answerReady = concatMap (\c -> answerClientOnly [if isReady c then "READY" else "NOT_READY", nick c]) sameRoomClients
 		sameRoomClients = filter (\ci -> room ci == roomName) clients
 		clRoom = roomByName roomName rooms