Changeset 135
- Timestamp:
- 05/14/07 03:27:00 (1 year ago)
- Files:
-
- trunk/src/birth.c (modified) (2 diffs)
- trunk/src/cmd4.c (modified) (1 diff)
- trunk/src/dungeon.c (modified) (7 diffs)
- trunk/src/externs.h (modified) (3 diffs)
- trunk/src/load.c (modified) (6 diffs)
- trunk/src/save.c (modified) (1 diff)
- trunk/src/util.c (modified) (2 diffs)
- trunk/src/variable.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/birth.c
r134 r135 1529 1529 cptr prompt = "['Q' to suicide, 'S' to start over, or any other key to continue]"; 1530 1530 1531 bool done = FALSE;1532 1533 1531 /* Ask questions */ 1534 1532 if (!player_birth_aux_1()) return (FALSE); … … 1549 1547 1550 1548 /* Get a name, prepare savefile */ 1551 get_name( );1549 get_name(FALSE); 1552 1550 1553 1551 /* Display the player */ trunk/src/cmd4.c
r125 r135 1765 1765 if ((ke.key == 'c') || ((ke.key == '\xff') && (ke.mousey == 2) && (ke.mousex < 26))) 1766 1766 { 1767 get_name( );1767 get_name(FALSE); 1768 1768 } 1769 1769 trunk/src/dungeon.c
r134 r135 1 1 2 /* File: dungeon.c */ 2 3 … … 10 11 11 12 #include "angband.h" 13 #include "z-file.h" 12 14 13 15 #include "script.h" … … 1837 1839 void play_game(bool new_game) 1838 1840 { 1841 bool character_loaded; 1842 bool reusing_savefile; 1843 1839 1844 /* Hack -- Increase "icky" depth */ 1840 1845 character_icky++; … … 1860 1865 1861 1866 /* Attempt to load */ 1862 if (!load_player( ))1867 if (!load_player(&character_loaded, &reusing_savefile)) 1863 1868 { 1864 1869 /* Oops */ … … 1874 1879 /* The dungeon is not ready */ 1875 1880 character_dungeon = FALSE; 1881 1882 /* XXX This is the place to add automatic character 1883 numbering (i.e. Rocky IV, V, etc.) Probably. */ 1876 1884 } 1877 1885 … … 1959 1967 process_player_name(TRUE); 1960 1968 } 1969 1970 /* Check if we're overwriting a savefile */ 1971 while (!reusing_savefile && my_fexists(savefile)) 1972 { 1973 /* Ask for confirmation */ 1974 bool newname = get_check("A savefile using that name already exists. Choose a new name? "); 1975 1976 if (newname) 1977 { 1978 get_name(TRUE); 1979 } 1980 else 1981 { 1982 break; 1983 } 1984 } 1961 1985 1962 1986 /* Flash a message */ … … 1976 2000 /* Window stuff */ 1977 2001 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER_0 | PW_PLAYER_1); 1978 1979 /* Window stuff */1980 2002 p_ptr->window |= (PW_MONSTER | PW_MESSAGE); 1981 1982 /* Window stuff */1983 2003 window_stuff(); 1984 2004 trunk/src/externs.h
r134 r135 99 99 extern bool character_generated; 100 100 extern bool character_dungeon; 101 extern bool character_loaded;102 101 extern bool character_saved; 103 102 extern s16b character_icky; … … 327 326 extern void do_cmd_help(void); 328 327 extern void process_player_name(bool sf); 329 extern void get_name( void);328 extern void get_name(bool sf); 330 329 extern void do_cmd_suicide(void); 331 330 extern void do_cmd_save_game(void); … … 352 351 353 352 /* load.c */ 354 extern bool load_player( void);353 extern bool load_player(bool *character_loaded, bool *reusing_savefile); 355 354 356 355 /* melee1.c */ trunk/src/load.c
r134 r135 2139 2139 * allowed to save his game when he quits. 2140 2140 * 2141 * We return "TRUE" if the savefile was usable, and we set the global2141 * We return "TRUE" if the savefile was usable, and we set the 2142 2142 * flag "character_loaded" if a real, living, character was loaded. 2143 2143 * … … 2145 2145 * there is no such file, so we must check for "empty" savefile names. 2146 2146 */ 2147 bool load_player( void)2147 bool load_player(bool *character_loaded, bool *reusing_savefile) 2148 2148 { 2149 2149 int fd = -1; … … 2158 2158 /* Paranoia */ 2159 2159 turn = 0; 2160 2161 /* Paranoia */2162 2160 p_ptr->is_dead = FALSE; 2163 2161 2162 *character_loaded = FALSE; 2163 *reusing_savefile = FALSE; 2164 2164 2165 2165 /* Allow empty savefile name */ … … 2286 2286 { 2287 2287 /* A character was loaded */ 2288 character_loaded = TRUE;2288 *character_loaded = TRUE; 2289 2289 2290 2290 /* Mark the savefile */ … … 2309 2309 2310 2310 /* A character was loaded */ 2311 character_loaded = TRUE;2311 *character_loaded = TRUE; 2312 2312 2313 2313 /* Still alive */ … … 2317 2317 strcpy(p_ptr->died_from, "(alive and well)"); 2318 2318 } 2319 2320 *reusing_savefile = TRUE; 2319 2321 2320 2322 /* Success */ trunk/src/save.c
r117 r135 1094 1094 safe_setuid_drop(); 1095 1095 1096 /* Hack -- Pretend the character was loaded */1097 character_loaded = TRUE;1098 1099 1096 /* Success */ 1100 1097 result = TRUE; trunk/src/util.c
r127 r135 2853 2853 * Gets a name for the character, reacting to name changes. 2854 2854 * 2855 * If sf is TRUE, we change the savefile name depending on the character name. 2856 * 2855 2857 * What a horrible name for a global function. XXX XXX XXX 2856 2858 */ 2857 void get_name( void)2859 void get_name(bool sf) 2858 2860 { 2859 2861 bool res; … … 2881 2883 2882 2884 /* Process the player name */ 2883 process_player_name( FALSE);2885 process_player_name(sf); 2884 2886 } 2885 2887 } trunk/src/variable.c
r82 r135 63 63 bool character_generated; /* The character exists */ 64 64 bool character_dungeon; /* The character has a dungeon */ 65 bool character_loaded; /* The character was loaded from a savefile */66 65 bool character_saved; /* The character was just saved to a savefile */ 67 66
