diff --git a/src/Commons.hs b/src/Commons.hs index b3ea430..71498cd 100644 --- a/src/Commons.hs +++ b/src/Commons.hs @@ -263,7 +263,8 @@ haskelloidShotDown h = do putAffection ud { wonlost = True } - putAffection ud + ud2 <- getAffection + putAffection ud2 { haskelloids = newHaskelloids } @@ -293,7 +294,10 @@ updateHaskelloid sec h@Haskelloid{..} = do 50 ) _ -> return Nothing - maybe (return ()) (const lose) lost + maybe (return ()) (const $ do + lose + putAffection ud {wonlost = True} + ) lost return h { hPos = (nnx, nny) , hRot = newRot diff --git a/src/InGame.hs b/src/InGame.hs index e711a97..750ea83 100644 --- a/src/InGame.hs +++ b/src/InGame.hs @@ -15,6 +15,7 @@ import Debug.Trace import Types import Commons +import Menu loadGame :: Affection UserData () loadGame = do @@ -103,7 +104,8 @@ updateGame sec = do } ud2 <- getAffection nhs <- mapM (updateHaskelloid sec) (haskelloids ud2) - putAffection ud2 + ud3 <- getAffection + putAffection ud3 { haskelloids = nhs } -- liftIO $ traceIO $ show $ length nhs