Permalink
Browse files

remove savefile if corrupted (but backup first)

  • Loading branch information...
Mikolaj committed Mar 23, 2011
1 parent f4fa77e commit d0e9837dfcff56375bdec5fc1c2d0d31d244b49c
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Save.hs
View
@@ -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 $

0 comments on commit d0e9837

Please sign in to comment.