Mercurial > hg > early-roguelike
comparison rogue4/main.c @ 30:09da55b986ca
Slightly modify savefile location and prompt
author | edwarj4 |
---|---|
date | Fri, 01 Jan 2010 15:04:30 +0000 |
parents | ea7372f5d314 |
children | 2dcd75e6a736 |
comparison
equal
deleted
inserted
replaced
29:da77eb183951 | 30:09da55b986ca |
---|---|
75 if (argc >= 3 && !strcmp(argv[1], "-n")) | 75 if (argc >= 3 && !strcmp(argv[1], "-n")) |
76 { | 76 { |
77 strncpy(whoami, argv[2], MAXSTR - 1); | 77 strncpy(whoami, argv[2], MAXSTR - 1); |
78 whoami[MAXSTR - 1] = '\0'; /* insurance */ | 78 whoami[MAXSTR - 1] = '\0'; /* insurance */ |
79 use_savedir = TRUE; | 79 use_savedir = TRUE; |
80 /* look for savefile at SAVEDIR/UIDplayername.r4sav */ | 80 /* look for savefile at SAVEDIR/UID-playername.r4sav */ |
81 if (snprintf(file_name, MAXSTR, "%s%d%.10s.r4sav", SAVEDIR, md_getuid(), | 81 if (snprintf(file_name, MAXSTR, "%s%d-%.10s.r4sav", SAVEDIR, |
82 whoami) >= MAXSTR) | 82 md_getuid(), whoami) >= MAXSTR) |
83 { | 83 { |
84 /* Name is too long- this shouldn't happen */ | 84 /* Name is too long- this shouldn't happen */ |
85 strcpy(file_name, "rogue4.save"); | 85 strcpy(file_name, "rogue4.save"); |
86 use_savedir = FALSE; | 86 use_savedir = FALSE; |
87 } | 87 } |