gameServer/EngineInteraction.hs
branchsdl2transition
changeset 9798 f2b18754742f
parent 9690 6a1748b71df2
child 10017 de822cd3df3a
child 10027 403b86a1d05f
--- a/gameServer/EngineInteraction.hs	Sat Dec 14 21:16:20 2013 +0400
+++ b/gameServer/EngineInteraction.hs	Tue Dec 17 00:02:52 2013 +0400
@@ -12,6 +12,7 @@
 import Data.Word
 import Data.Bits
 import Control.Arrow
+import Data.Maybe
 -------------
 import CoreTypes
 import Utils
@@ -74,7 +75,7 @@
         em = toEngineMsg
         eml = em . B.concat
         mapGenTypes = ["+rnd+", "+maze+", "+drawn+"]
-        maybeScript = let s = head $ prms Map.! "SCRIPT" in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
+        maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]]
         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"