fix displaying the screenshot even for old-version savegames.

git-svn-id: https://svn.eduke32.com/eduke32@2210 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-12-25 15:34:52 +00:00
parent a3a80467a7
commit 5ef480ad7a

View file

@ -221,7 +221,7 @@ void ReadSaveGameHeaders(void)
int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh) int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh)
{ {
char fn[16]; char fn[16];
int32_t fil, screenshotofs; int32_t fil, screenshotofs, i;
Bstrcpy(fn, "dukesav0.esv"); Bstrcpy(fn, "dukesav0.esv");
fn[7] = spot + '0'; fn[7] = spot + '0';
@ -230,7 +230,8 @@ int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh)
if (fil == -1) if (fil == -1)
return -1; return -1;
if (sv_loadheader(fil, spot, saveh)) i = sv_loadheader(fil, spot, saveh);
if (i && (i != 2 && i != 3))
goto corrupt; goto corrupt;
if (kread(fil, &screenshotofs, 4) != 4) if (kread(fil, &screenshotofs, 4) != 4)
@ -244,8 +245,11 @@ int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh)
if (screenshotofs) if (screenshotofs)
{ {
if (kdfread((char *)waloff[TILE_LOADSHOT], 320, 200, fil) != 200) if (kdfread((char *)waloff[TILE_LOADSHOT], 320, 200, fil) != 200)
{
OSD_Printf("G_LoadSaveHeaderNew(%d): failed reading screenshot\n", spot);
goto corrupt; goto corrupt;
} }
}
else else
{ {
Bmemset((char *)waloff[TILE_LOADSHOT], 0, 320*200); Bmemset((char *)waloff[TILE_LOADSHOT], 0, 320*200);