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.
This commit is contained in:
parent
d309fcdd46
commit
8690ea40f3
1 changed files with 12 additions and 0 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "rogue.h"
|
#include "rogue.h"
|
||||||
|
|
||||||
|
#define CHRDIR "."
|
||||||
|
|
||||||
#define I_STR 0
|
#define I_STR 0
|
||||||
#define I_INTEL 1
|
#define I_INTEL 1
|
||||||
#define I_WISDOM 2
|
#define I_WISDOM 2
|
||||||
|
|
@ -36,6 +38,16 @@ static void get_chr_filename(char *filename, int size)
|
||||||
|
|
||||||
home = getenv("HOME");
|
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 (home) {
|
||||||
if ((int)strlen(home) < (size - 12) )
|
if ((int)strlen(home) < (size - 12) )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue