Test two defeat cases.
[open-adventure.git] / saveresume.c
index e6961d2c60fbcb467d63287704ce637a100f140c..015b4be88c383440aae845e04715ae2192007416 100644 (file)
@@ -86,19 +86,23 @@ int resume(FILE *input)
        linenoiseFree(name);
     }
 
+       return restore(fp);
+}
+
+int restore(FILE* fp){
     IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
     fclose(fp);
     if (save.version != VRSION) {
-       SETPRM(1,save.version/10,MOD(save.version,10));
-       SETPRM(3,VRSION/10,MOD(VRSION,10));
-       RSPEAK(VERSION_SKEW);
+        SETPRM(1,save.version/10,MOD(save.version,10));
+        SETPRM(3,VRSION/10,MOD(VRSION,10));
+        RSPEAK(VERSION_SKEW);
     } else {
-       memcpy(&game, &save.game, sizeof(struct game_t));
-       OBJSND[BIRD] = save.bird;
-       OBJTXT[OYSTER] = save.bivalve;
-       game.zzword=RNDVOC(3,game.zzword);
+        memcpy(&game, &save.game, sizeof(struct game_t));
+        OBJSND[BIRD] = save.bird;
+        OBJTXT[OYSTER] = save.bivalve;
+        game.zzword=RNDVOC(3,game.zzword);
     }
     return GO_TOP;
 }
 
-/* end */
+/* end */
\ No newline at end of file