gameServer/ServerCore.hs
branchqmlfrontend
changeset 11481 caa1e84c3ac2
parent 11466 4b5c7a5c49fd
--- a/gameServer/ServerCore.hs	Fri Jan 01 19:14:59 2016 +0300
+++ b/gameServer/ServerCore.hs	Fri Jan 01 19:15:32 2016 +0300
@@ -23,7 +23,7 @@
 import System.Log.Logger
 import Control.Monad.Reader
 import Control.Monad.State.Strict
-import Data.Set as Set
+import Data.Set as Set hiding (null)
 import Data.Unique
 import Data.Maybe
 --------------------------------------
@@ -55,6 +55,10 @@
             unless (ci `Set.member` removed) $ do
                 modify (\s -> s{clientIndex = Just ci})
                 processAction $ ReactCmd cmd
+                pa <- client's pendingActions
+                when (not $ null pa) $ do
+                    mapM_ processAction pa
+                    processAction $ ModifyClient $ \c -> c{pendingActions = []}
 
         Remove ci ->
             processAction (DeleteClient ci)