Mercurial > hg > early-roguelike
comparison srogue/save.c @ 38:8a9525231fb6
Prevent changing name or savefile when SAVEDIR is used.
| author | elwin | 
|---|---|
| date | Sat, 27 Nov 2010 16:22:30 +0000 | 
| parents | 34d7a614855e | 
| children | 3aa87373c908 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 37:34d7a614855e | 38:8a9525231fb6 | 
|---|---|
| 56 reg int c; | 56 reg int c; | 
| 57 char buf[LINLEN]; | 57 char buf[LINLEN]; | 
| 58 | 58 | 
| 59 mpos = 0; | 59 mpos = 0; | 
| 60 if (file_name[0] != '\0') { | 60 if (file_name[0] != '\0') { | 
| 61 msg("Save file (%s)? ", file_name); | 61 if (use_savedir) | 
| 62 msg("Save game? (y/n) "); | |
| 63 else | |
| 64 msg("Save file (%s)? ", file_name); | |
| 62 do { | 65 do { | 
| 63 c = wgetch(cw); | 66 c = wgetch(cw); | 
| 64 if(c == ESCAPE) { | 67 if(c == ESCAPE) { | 
| 65 msg(""); | 68 msg(""); | 
| 66 return FALSE; | 69 return FALSE; | 
| 67 } | 70 } | 
| 68 } while (c != 'n' && c != 'y'); | 71 } while (c != 'n' && c != 'y'); | 
| 69 mpos = 0; | 72 mpos = 0; | 
| 70 if (c == 'y') | 73 if (c == 'y') | 
| 71 goto gotfile; | 74 goto gotfile; | 
| 75 } | |
| 76 if (use_savedir) { | |
| 77 msg(""); | |
| 78 return FALSE; | |
| 72 } | 79 } | 
| 73 msg("File name: "); | 80 msg("File name: "); | 
| 74 mpos = 0; | 81 mpos = 0; | 
| 75 buf[0] = '\0'; | 82 buf[0] = '\0'; | 
| 76 if (get_str(buf, cw) == QUIT) { | 83 if (get_str(buf, cw) == QUIT) { | 
