From 5ef480ad7a1afa8a47153d32f5f5cb4d2c2f29e5 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 25 Dec 2011 15:34:52 +0000 Subject: [PATCH] fix displaying the screenshot even for old-version savegames. git-svn-id: https://svn.eduke32.com/eduke32@2210 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/savegame.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 4e4646f25..ffec83e8e 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -221,7 +221,7 @@ void ReadSaveGameHeaders(void) int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh) { char fn[16]; - int32_t fil, screenshotofs; + int32_t fil, screenshotofs, i; Bstrcpy(fn, "dukesav0.esv"); fn[7] = spot + '0'; @@ -230,7 +230,8 @@ int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh) if (fil == -1) return -1; - if (sv_loadheader(fil, spot, saveh)) + i = sv_loadheader(fil, spot, saveh); + if (i && (i != 2 && i != 3)) goto corrupt; if (kread(fil, &screenshotofs, 4) != 4) @@ -244,7 +245,10 @@ int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh) if (screenshotofs) { if (kdfread((char *)waloff[TILE_LOADSHOT], 320, 200, fil) != 200) + { + OSD_Printf("G_LoadSaveHeaderNew(%d): failed reading screenshot\n", spot); goto corrupt; + } } else {