# HG changeset patch
# User unc0rr
# Date 1329409967 -14400
# Node ID 46b3f477653842c63d1a3bc7c80d6684c9fab238
# Parent  98a239848ba2bfd4c8bb7774c0dd37d413a98e6a
Send team removal message on incorrect engine shutdown (when game not finished). Should help with game hang when room master closes engine, then quits room.

diff -r 98a239848ba2 -r 46b3f4776538 gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Thu Feb 16 16:16:59 2012 +0100
+++ b/gameServer/HWProtoInRoomState.hs	Thu Feb 16 20:32:47 2012 +0400
@@ -206,11 +206,12 @@
 
 
 handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
+    clId <- asks fst
     cl <- thisClient
     rm <- thisRoom
     chans <- roomClientsChans
 
-    if isMaster cl && (isJust $ gameInfo rm) then
+    if isMaster cl && isCorrect && (isJust $ gameInfo rm) then
         return $
             SaveReplay
             : ModifyRoom
@@ -222,7 +223,7 @@
             : UnreadyRoomClients
             : answerRemovedTeams chans rm
         else
-        return []
+        return [RemoveClientTeams clId]
     where
         answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
         isCorrect = correctly == "1"