# HG changeset patch # User John "Elwin" Edwards # Date 1487551629 18000 # Node ID 778938a5c21d8b93a3184d39e8d42853946cb150 # Parent 08057be02f479363bb9e1ffbb03726852887c4a4 UltraRogue: add location for character files. When using the -n option, UltraRogue will look for character files in a single location, similar to save files. The location is chosen by defining CHRDIR in getplay.c, at least until UltraRogue gets integrated with the build systems. diff -r 08057be02f47 -r 778938a5c21d urogue/getplay.c --- a/urogue/getplay.c Wed Feb 15 20:38:12 2017 -0500 +++ b/urogue/getplay.c Sun Feb 19 19:47:09 2017 -0500 @@ -16,6 +16,8 @@ #include #include "rogue.h" +#define CHRDIR "." + #define I_STR 0 #define I_INTEL 1 #define I_WISDOM 2 @@ -36,6 +38,16 @@ home = getenv("HOME"); +#ifdef CHRDIR + if (use_savedir) + { + strncpy(filename, CHRDIR, size); + filename[size-1] = '\0'; + snprintf(filename, size, "%s/%d-%.80s.chr", CHRDIR, md_getuid(), + whoami); + return; + } +#endif if (home) { if ((int)strlen(home) < (size - 12) ) {