changeset 30:09da55b986ca

Slightly modify savefile location and prompt
author edwarj4
date Fri, 01 Jan 2010 15:04:30 +0000
parents da77eb183951
children 9223b6d7a243
files rogue3/main.c rogue3/save.c rogue4/main.c rogue4/save.c
diffstat 4 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/rogue3/main.c	Tue Dec 29 12:45:38 2009 +0000
+++ b/rogue3/main.c	Fri Jan 01 15:04:30 2010 +0000
@@ -70,8 +70,8 @@
         strncpy(whoami, argv[2], 79);
         whoami[79] = '\0';
         use_savedir = TRUE;
-        /* look for savefile at SAVEDIR/UIDplayername.r3sav */
-        if (snprintf(file_name, 80, "%s%d%.10s.r3sav", SAVEDIR, md_getuid(), whoami) >= 80)
+        /* look for savefile at SAVEDIR/UID-playername.r3sav */
+        if (snprintf(file_name, 80, "%s%d-%.10s.r3sav", SAVEDIR, md_getuid(), whoami) >= 80)
         {
             /* this shouldn't happen */
             strcpy(file_name, "rogue3.save");
--- a/rogue3/save.c	Tue Dec 29 12:45:38 2009 +0000
+++ b/rogue3/save.c	Fri Jan 01 15:04:30 2010 +0000
@@ -40,7 +40,10 @@
     mpos = 0;
     if (file_name[0] != '\0')
     {
-	msg("Save file (%s)? ", file_name);
+	if (use_savedir)
+	    msg("Save game? ");
+	else
+	    msg("Save file (%s)? ", file_name);
 	do
 	{
 	    c = readchar(cw);
--- a/rogue4/main.c	Tue Dec 29 12:45:38 2009 +0000
+++ b/rogue4/main.c	Fri Jan 01 15:04:30 2010 +0000
@@ -77,9 +77,9 @@
         strncpy(whoami, argv[2], MAXSTR - 1);
         whoami[MAXSTR - 1] = '\0'; /* insurance */
         use_savedir = TRUE;
-        /* look for savefile at SAVEDIR/UIDplayername.r4sav */
-        if (snprintf(file_name, MAXSTR, "%s%d%.10s.r4sav", SAVEDIR, md_getuid(),
-            whoami) >= MAXSTR)
+        /* look for savefile at SAVEDIR/UID-playername.r4sav */
+        if (snprintf(file_name, MAXSTR, "%s%d-%.10s.r4sav", SAVEDIR, 
+            md_getuid(), whoami) >= MAXSTR)
         {
             /* Name is too long- this shouldn't happen */
             strcpy(file_name, "rogue4.save");
--- a/rogue4/save.c	Tue Dec 29 12:45:38 2009 +0000
+++ b/rogue4/save.c	Fri Jan 01 15:04:30 2010 +0000
@@ -48,7 +48,10 @@
     {
 	for (;;)
 	{
-	    msg("save file (%s)? ", file_name);
+	    if (use_savedir)
+		msg("Save game? ");
+	    else
+		msg("save file (%s)? ", file_name);
 	    c = getchar();
 	    mpos = 0;
 	    if (c == ESCAPE)