gameServer/EngineInteraction.hs
changeset 9690 6a1748b71df2
parent 9401 2af7bea32e5e
child 10017 de822cd3df3a
child 10027 403b86a1d05f
--- a/gameServer/EngineInteraction.hs	Fri Nov 08 23:11:27 2013 -0500
+++ b/gameServer/EngineInteraction.hs	Tue Nov 12 15:38:45 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"