Use mod_dir for savegames

git-svn-id: https://svn.eduke32.com/eduke32@994 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-08-20 09:27:17 +00:00
parent cbba90b7c2
commit 6def1b0a65
4 changed files with 10 additions and 7 deletions

View file

@ -1057,6 +1057,9 @@ typedef struct {
extern keydef keynames[];
extern char *mousenames[];
extern char *duke3dgrp, *duke3dgrpstring;
extern char mod_dir[BMAX_PATH];
#ifdef __cplusplus
}
#endif

View file

@ -4623,7 +4623,6 @@ repeatcase:
if (Bstrcmp(setupfilename,"duke3d.cfg") == 0) // not set to something else via -cfg
{
char temp[BMAX_PATH];
extern char mod_dir[];
Bstrcpy(temp,tempbuf);
CONFIG_WriteSetup();
Bsprintf(setupfilename,"%s/",mod_dir);

View file

@ -83,7 +83,7 @@ int loadpheader(char spot,struct savehead *saveh)
strcpy(fn, "egam0.sav");
fn[4] = spot+'0';
if ((fil = kopen4load(fn,0)) == -1) return(-1);
if ((fil = kopen4loadfrommod(fn,0)) == -1) return(-1);
walock[TILE_LOADSHOT] = 255;
@ -161,7 +161,7 @@ int loadplayer(int spot)
fn[4] = spot + '0';
}
if ((fil = kopen4load(fnptr,0)) == -1) return(-1);
if ((fil = kopen4loadfrommod(fnptr,0)) == -1) return(-1);
ready2send = 0;
@ -566,7 +566,11 @@ int saveplayer(int spot)
fn[4] = spot + '0';
}
if ((fil = fopen(fnptr,"wb")) == 0) return(-1);
{
char temp[BMAX_PATH];
Bsprintf(temp,"%s/%s",mod_dir,fnptr);
if ((fil = fopen(temp,"wb")) == 0) return(-1);
}
ready2send = 0;

View file

@ -600,9 +600,6 @@ int startwin_idle(void *v)
return 0;
}
extern char *duke3dgrp, *duke3dgrpstring;
extern char mod_dir[BMAX_PATH];
int startwin_run(void)
{
MSG msg;