- Send maze_size command in other mapgen modes too
authorunc0rr
Tue, 06 Jan 2015 12:12:34 +0300
changeset 10777 18afcfaa4d5a
parent 10776 56e401fb45ea
child 10779 d85fe0cb5df2
- Send maze_size command in other mapgen modes too - Fix drawn land mapgen detection
gameServer/EngineInteraction.hs
--- a/gameServer/EngineInteraction.hs	Mon Jan 05 16:29:27 2015 +0100
+++ b/gameServer/EngineInteraction.hs	Tue Jan 06 12:12:34 2015 +0300
@@ -124,10 +124,10 @@
         maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]]
         scheme = tail $ prms Map.! "SCHEME"
         mapgen = mParams Map.! "MAPGEN"
+        templateFilterMsg = eml ["e$maze_size ", mParams Map.! "MAZE_SIZE"]
         mapgenSpecific = case mapgen of
-            "1" -> [eml ["e$maze_size ", mParams Map.! "MAZE_SIZE"]]
-            "2" -> let d = head . fromMaybe [""] $ Map.lookup "DRAWNMAP" prms in if BW.length d <= 4 then [] else drawnMapData d
-            _ -> []
+            "3" -> let d = head . fromMaybe [""] $ Map.lookup "DRAWNMAP" prms in if BW.length d <= 4 then [] else drawnMapData d
+            _ -> [templateFilterMsg]
         gameFlags :: Word32
         gameFlags = foldl (\r (b, f) -> if b == "false" then r else r .|. f) 0 $ zip scheme gameFlagConsts
         schemeFlags = map (\(v, (n, m)) -> eml [n, " ", showB $ (readInt_ v) * m])