From 7eb2e42a3c40814f2d9d3c5aec694938df265e89 Mon Sep 17 00:00:00 2001 From: Brian Koropoff Date: Sun, 16 Feb 2003 22:43:06 +0000 Subject: [PATCH] Made QFS_NextFilename use Qexpand_squiggle on fs_userpath so screenshots are saved to sequential filenames correctly. This might be temporary if taniwha has a better way of handling squiggle expansion in QFS in mind. --- libs/util/quakefs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 90a7558e9..3a2d2abe0 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -1228,7 +1228,7 @@ int QFS_NextFilename (char *filename, const char *prefix, const char *ext) { char *digits; - char checkname[MAX_OSPATH]; + char checkname[MAX_OSPATH], exp[MAX_OSPATH]; int i; strncpy (filename, prefix, MAX_OSPATH - 4); @@ -1236,13 +1236,14 @@ QFS_NextFilename (char *filename, const char *prefix, const char *ext) digits = filename + strlen (filename); strcat (filename, "000"); strncat (filename, ext, MAX_OSPATH - strlen (filename)); - + Qexpand_squiggle (fs_userpath->string, exp); + for (i = 0; i <= 999; i++) { digits[0] = i / 100 + '0'; digits[1] = i / 10 % 10 + '0'; digits[2] = i % 10 + '0'; snprintf (checkname, sizeof (checkname), - "%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, + "%s/%s/%s", exp, qfs_gamedir->dir.def, filename); if (Sys_FileTime (checkname) == -1) return 1; // file doesn't exist