Pass hogs names and hats
authorunc0rr
Wed, 13 Feb 2013 22:59:41 +0400
changeset 8503 e60c84b42f4d
parent 8502 fb8d914e76d8
child 8504 9ff55b527d1b
Pass hogs names and hats
gameServer/EngineInteraction.hs
--- a/gameServer/EngineInteraction.hs	Wed Feb 13 21:13:15 2013 +0400
+++ b/gameServer/EngineInteraction.hs	Wed Feb 13 22:59:41 2013 +0400
@@ -93,7 +93,13 @@
                 eml ["eaddteam <hash> ", showB $ (1 + (readInt_ $ teamcolor t) :: Int) * 1234, " ", teamname t]
                 : em "erdriven"
                 : eml ["efort ", teamfort t]
-                : replicate (hhnum t) (eml ["eaddhh 0 ", initHealth, " hedgehog"])
+                : take (hhnum t) (
+                    concatMap (\(HedgehogInfo hname hhat) -> [
+                            eml ["eaddhh ", showB $ difficulty t, " ", initHealth, " ", hname]
+                            , eml ["ehat ", hhat]
+                            ])
+                        $ hedgehogs t
+                        )
 
 drawnMapData :: B.ByteString -> [B.ByteString]
 drawnMapData = error "drawnMapData"