fix state fuckup
This commit is contained in:
parent
79642ec557
commit
e59ecbd1e1
2 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue