git-svn-id: https://svn.eduke32.com/eduke32@995 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-08-20 09:38:36 +00:00
parent 6def1b0a65
commit 1c785bb975

View file

@ -33,44 +33,44 @@ void readsavenames(void)
int dummy,j; int dummy,j;
int i; int i;
char fn[13]; char fn[13];
BFILE *fil; int fil;
Bstrcpy(fn,"egam_.sav"); Bstrcpy(fn,"egam_.sav");
for (i=0;i<10;i++) for (i=0;i<10;i++)
{ {
fn[4] = i+'0'; fn[4] = i+'0';
if ((fil = Bfopen(fn,"rb")) == NULL) continue; if ((fil = kopen4loadfrommod(fn,0)) == -1) continue;
if (dfread(&j,sizeof(int),1,fil) != 1) if (kdfread(&j,sizeof(int),1,fil) != 1)
{ {
Bfclose(fil); kclose(fil);
continue; continue;
} }
if (dfread(g_szBuf,j,1,fil) != 1) if (kdfread(g_szBuf,j,1,fil) != 1)
{ {
Bfclose(fil); kclose(fil);
continue; continue;
} }
if (dfread(&dummy,4,1,fil) != 1) if (kdfread(&dummy,4,1,fil) != 1)
{ {
Bfclose(fil); kclose(fil);
continue; continue;
} }
if (dummy != BYTEVERSION) if (dummy != BYTEVERSION)
{ {
Bfclose(fil); kclose(fil);
continue; continue;
} }
if (dfread(&dummy,4,1,fil) != 1) if (kdfread(&dummy,4,1,fil) != 1)
{ {
Bfclose(fil); kclose(fil);
continue; continue;
} }
if (dfread(&ud.savegame[i][0],19,1,fil) != 1) if (kdfread(&ud.savegame[i][0],19,1,fil) != 1)
{ {
ud.savegame[i][0] = 0; ud.savegame[i][0] = 0;
} }
Bfclose(fil); kclose(fil);
} }
} }
@ -568,7 +568,9 @@ int saveplayer(int spot)
{ {
char temp[BMAX_PATH]; char temp[BMAX_PATH];
Bsprintf(temp,"%s/%s",mod_dir,fnptr); if (mod_dir[0] != '/')
Bsprintf(temp,"%s/%s",mod_dir,fnptr);
else Bsprintf(temp,"%s",fnptr);
if ((fil = fopen(temp,"wb")) == 0) return(-1); if ((fil = fopen(temp,"wb")) == 0) return(-1);
} }