Skip to content
Browse files

remove savefile if corrupted (but backup first)

  • Loading branch information...
1 parent f4fa77e commit d0e9837dfcff56375bdec5fc1c2d0d31d244b49c @Mikolaj Mikolaj committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Save.hs
View
4 src/Save.hs
@@ -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.
Something went wrong with that request. Please try again.