gameServer/ServerCore.hs
changeset 11471 4b5c7a5c49fd
parent 11046 47a8c19ecb60
--- a/gameServer/ServerCore.hs	Mon Dec 28 21:21:02 2015 +0300
+++ b/gameServer/ServerCore.hs	Mon Dec 28 21:51:12 2015 +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)