gameServer/Actions.hs
changeset 11582 bee3a2f8e117
parent 11580 db7743e2fad1
child 11585 c8edd93b970f
--- a/gameServer/Actions.hs	Fri Feb 26 14:11:16 2016 -0500
+++ b/gameServer/Actions.hs	Sat Feb 27 09:44:13 2016 +0300
@@ -733,11 +733,12 @@
     ri <- clientRoomA
     rnc <- gets roomsClients
     thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
+    rm <- io $ room'sM rnc id ri
+    when (roomProto rm > 51) $ do
+        processAction $ ModifyRoom $ \r -> r{params = Map.insert "DRAWNMAP" [prependGhostPoints (toP points) $ head $ (params r) Map.! "DRAWNMAP"] (params r)}
     -- inject ghost points into map
-    rm <- io $ room'sM rnc id ri
     cl <- client's id
-    mapM processAction $ map (replaceChans thisRoomChans) $ answerFullConfigParams cl (mapParams rm) (params rm)
-    return ()
+    mapM_ processAction $ map (replaceChans thisRoomChans) $ answerFullConfigParams cl (mapParams rm) (params rm)
     where
     loadFile :: String -> IO [Int]
     loadFile fileName = E.handle (\(e :: SomeException) -> return []) $ do
@@ -745,6 +746,8 @@
         return (points `deepseq` points)
     replaceChans chans (AnswerClients _ msg) = AnswerClients chans msg
     replaceChans _ a = a
+    toP [] = []
+    toP (p1:p2:ps) = (fromIntegral p1, fromIntegral p2) : toP ps
 {-
         let a = map (replaceChans chans) $ answerFullConfigParams cl mp p
 -}