--- a/gameServer/Actions.hs Mon Dec 14 18:52:04 2009 +0000
+++ b/gameServer/Actions.hs Mon Dec 14 20:23:51 2009 +0000
@@ -100,10 +100,12 @@
processAction (clID, serverInfo, clients, rooms) (AnswerSameClan msg) = do
- mapM_ (\cl -> writeChan (sendChan cl) msg) sameClanClients
+ mapM_ (\cl -> writeChan (sendChan cl) msg) sameClanOrSpec
return (clID, serverInfo, clients, rooms)
where
otherRoomClients = Prelude.map ((!) clients) $ IntSet.elems $ clID `IntSet.delete` (playersIDs room)
+ sameClanOrSpec = if teamsInGame client > 0 then sameClanClients else spectators
+ spectators = Prelude.filter (\cl -> teamsInGame cl == 0) otherRoomClients
sameClanClients = Prelude.filter (\cl -> teamsInGame cl > 0 && clientClan cl == thisClan) otherRoomClients
thisClan = clientClan client
room = rooms ! rID