fix state fuckup

This commit is contained in:
nek0 2017-02-26 02:14:49 +01:00
parent 79642ec557
commit e59ecbd1e1
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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