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
|
||||
|
||||
* 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
|
||||
|
||||
|
|
|
@ -86,6 +86,15 @@ char *game_save_path(int cr, int nr)
|
|||
struct passwd *pw;
|
||||
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;
|
||||
}
|
||||
|
||||
pw = getpwuid(getuid());
|
||||
if (!pw)
|
||||
return NULL;
|
||||
|
|
|
@ -132,6 +132,18 @@ char *game_cfg_path( void )
|
|||
char *game_save_path( int cr, int nr )
|
||||
{
|
||||
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() );
|
||||
|
||||
snprintf(save_path, sizeof(save_path) - 1 , "%s/instead", appdir);
|
||||
|
|
Loading…
Reference in a new issue