Skip to content

Commit

Permalink
remove savefile if corrupted (but backup first)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj committed Mar 23, 2011
1 parent f4fa77e commit d0e9837
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Save.hs
Expand Up @@ -26,9 +26,9 @@ saveGame state =
restoreGame :: Config.CP -> IO (Either State String)
restoreGame config =
E.catch (do
f <- file config
(x, z) <- strictDecodeCompressedFile f
mvBkp config
f <- file config
(x, z) <- strictDecodeCompressedFile (f ++ ".bkp")
(z :: Bool) `seq` return $ Left x)
(\ e -> case e :: IOException of
_ -> return (Right $
Expand Down

0 comments on commit d0e9837

Please sign in to comment.