Mercurial > hg > early-roguelike
comparison rogue3/rip.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 | 0ef99244acb8 |
children | c199a15a2c70 |
comparison
equal
deleted
inserted
replaced
111:7f8f43943b1f | 112:ee250e3646fd |
---|---|
306 fclose(outf); | 306 fclose(outf); |
307 } | 307 } |
308 | 308 |
309 void writelog(int amount, int flags, int monst) | 309 void writelog(int amount, int flags, int monst) |
310 { | 310 { |
311 char logmessage[160], ltemp[80]; | 311 char logmessage[220], ltemp[80]; |
312 char *killer; | 312 char *killer; |
313 | 313 |
314 if (waswizard) | 314 if (waswizard) |
315 return; | 315 return; |
316 #ifdef LOGFILE | 316 #ifdef LOGFILE |
317 sprintf(logmessage, "%d %d %.20s %d ", time(NULL), amount, whoami, | 317 sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, |
318 pstats.s_lvl); | 318 pstats.s_lvl); |
319 if (flags == 0) /* died */ | 319 if (flags == 0) /* died */ |
320 { | 320 { |
321 strcat(logmessage, "killed by a"); | 321 strcat(logmessage, "killed by a"); |
322 killer = killname(monst); | 322 killer = killname(monst); |