comparison arogue5/rogue.c @ 112:ee250e3646fd

Don't truncate player name in savefile name or log message. The player name is stored in whoami[], which is length 80 in most games (1024 in rogue5). Only the first 10 chars were used to create file_name, because that buffer is the same length. Increasing the size of file_name to 256 permits using all of whoami. The name is also no longer truncated to 20 chars when writing the log. All games should now be able to handle 79-character names without collisions. Anything more would break save compatibility.
author John "Elwin" Edwards
date Sun, 23 Mar 2014 21:27:14 -0700
parents 19903deed392
children aac28331e71d
comparison
equal deleted inserted replaced
111:7f8f43943b1f 112:ee250e3646fd
82 char *p_guess[MAXPOTIONS]; /* Players guess at what potion is */ 82 char *p_guess[MAXPOTIONS]; /* Players guess at what potion is */
83 char *r_guess[MAXRINGS]; /* Players guess at what ring is */ 83 char *r_guess[MAXRINGS]; /* Players guess at what ring is */
84 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */ 84 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
85 char *m_guess[MAXMM]; /* Players guess at what MM is */ 85 char *m_guess[MAXMM]; /* Players guess at what MM is */
86 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ 86 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
87 char file_name[LINELEN]; /* Save file name */ 87 char file_name[256]; /* Save file name */
88 char score_file[LINELEN]; /* Score file name */ 88 char score_file[LINELEN]; /* Score file name */
89 char home[LINELEN]; /* User's home directory */ 89 char home[LINELEN]; /* User's home directory */
90 WINDOW *cw; /* Window that the player sees */ 90 WINDOW *cw; /* Window that the player sees */
91 WINDOW *hw; /* Used for the help command */ 91 WINDOW *hw; /* Used for the help command */
92 WINDOW *mw; /* Used to store mosnters */ 92 WINDOW *mw; /* Used to store mosnters */