save slots into game/saves if game/saves exists
This commit is contained in:
parent
928bef5af5
commit
ed5631e6d4
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -1,6 +1,7 @@
|
||||||
instead (1.0.4) unstable; urgency=low
|
instead (1.0.4) unstable; urgency=low
|
||||||
|
|
||||||
* xref hl optimization
|
* xref hl optimization
|
||||||
|
* now, write save slots in game/saves if game/saves exist
|
||||||
|
|
||||||
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 12 Dec 2009 17:15:00 +0300
|
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 12 Dec 2009 17:15:00 +0300
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,15 @@ char *game_save_path(int cr, int nr)
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
if (!curgame_dir)
|
if (!curgame_dir)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (!access("saves", R_OK)) {
|
||||||
|
if (nr)
|
||||||
|
snprintf(save_path, sizeof(save_path) - 1, "saves/save%d", nr);
|
||||||
|
else
|
||||||
|
snprintf(save_path, sizeof(save_path) - 1, "saves/autosave");
|
||||||
|
return save_path;
|
||||||
|
}
|
||||||
|
|
||||||
pw = getpwuid(getuid());
|
pw = getpwuid(getuid());
|
||||||
if (!pw)
|
if (!pw)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -132,6 +132,18 @@ char *game_cfg_path( void )
|
||||||
char *game_save_path( int cr, int nr )
|
char *game_save_path( int cr, int nr )
|
||||||
{
|
{
|
||||||
char appdir[PATH_MAX];
|
char appdir[PATH_MAX];
|
||||||
|
|
||||||
|
if (!curgame_dir)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!access("saves", R_OK)) {
|
||||||
|
if (nr)
|
||||||
|
snprintf(save_path, sizeof(save_path) - 1, "saves/save%d", nr);
|
||||||
|
else
|
||||||
|
snprintf(save_path, sizeof(save_path) - 1, "saves/autosave");
|
||||||
|
return save_path;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy( appdir, app_dir() );
|
strcpy( appdir, app_dir() );
|
||||||
|
|
||||||
snprintf(save_path, sizeof(save_path) - 1 , "%s/instead", appdir);
|
snprintf(save_path, sizeof(save_path) - 1 , "%s/instead", appdir);
|
||||||
|
|
Loading…
Reference in a new issue