Mercurial > hg > early-roguelike
comparison srogue/global.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 | 34d7a614855e |
children | 78fa1d0e5d25 |
comparison
equal
deleted
inserted
replaced
111:7f8f43943b1f | 112:ee250e3646fd |
---|---|
60 | 60 |
61 char prbuf[LINLEN]; /* Buffer for sprintfs */ | 61 char prbuf[LINLEN]; /* Buffer for sprintfs */ |
62 char whoami[LINLEN]; /* Name of player */ | 62 char whoami[LINLEN]; /* Name of player */ |
63 char fruit[LINLEN]; /* Favorite fruit */ | 63 char fruit[LINLEN]; /* Favorite fruit */ |
64 char huh[LINLEN]; /* The last message printed */ | 64 char huh[LINLEN]; /* The last message printed */ |
65 char file_name[LINLEN]; /* Save file name */ | 65 char file_name[256]; /* Save file name */ |
66 char scorefile[LINLEN]; /* place for scorefile */ | 66 char scorefile[LINLEN]; /* place for scorefile */ |
67 char home[LINLEN]; /* User's home directory */ | 67 char home[LINLEN]; /* User's home directory */ |
68 char outbuf[BUFSIZ]; /* Output buffer for stdout */ | 68 char outbuf[BUFSIZ]; /* Output buffer for stdout */ |
69 | 69 |
70 char *s_guess[MAXSCROLLS]; /* his guess at what scroll is */ | 70 char *s_guess[MAXSCROLLS]; /* his guess at what scroll is */ |