From 866b5caee0140d35c724ed82bee585a85058489c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 21 Jun 2015 17:57:13 +0300 Subject: [PATCH] Text tombstone overflow and helpless Betatesters noticed the death message could overflow the text tombstone, because the helpless reason was also shown there. So don't show the helpless at all in the tombstone. The helpless is still put in the record, logfile, and as a separate while-field in xlogfile. --- src/end.c | 6 ------ src/topten.c | 10 +++++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/end.c b/src/end.c index b422670c4..0500bc4d8 100644 --- a/src/end.c +++ b/src/end.c @@ -478,12 +478,6 @@ int how; Sprintf(eos(buf), " called %s", MNAME(mtmp)); } - if (multi) { - if (multi_reason) - Sprintf(eos(buf), ", while %s", multi_reason); - else - Strcat(buf, ", while helpless"); - } Strcpy(killer.name, buf); if (mptr->mlet == S_WRAITH) u.ugrave_arise = PM_WRAITH; diff --git a/src/topten.c b/src/topten.c index 9a234b713..b4ab1abd8 100644 --- a/src/topten.c +++ b/src/topten.c @@ -262,10 +262,10 @@ struct toptenentry *tt; static const char fmt33[] = "%s %s %s %s "; /* role,race,gndr,algn */ #ifndef NO_SCAN_BRACK static const char fmt0[] = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d "; - static const char fmtX[] = "%s,%s\n"; + static const char fmtX[] = "%s,%s%s%s\n"; #else /* NO_SCAN_BRACK */ static const char fmt0[] = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d "; - static const char fmtX[] = "%s %s\n"; + static const char fmtX[] = "%s %s%s%s\n"; nsb_mung_line(tt->name); nsb_mung_line(tt->death); @@ -281,7 +281,9 @@ struct toptenentry *tt; (void) fprintf(rfile, fmt33, tt->plrole, tt->plrace, tt->plgend, tt->plalign); (void) fprintf(rfile, fmtX, onlyspace(tt->name) ? "_" : tt->name, - tt->death); + tt->death, + (multi ? ", while " : ""), + (multi ? (multi_reason ? multi_reason : "helpless") : "")); #ifdef NO_SCAN_BRACK nsb_unmung_line(tt->name); @@ -315,6 +317,8 @@ struct toptenentry *tt; Fprintf(rfile, "%s%cname=%s%cdeath=%s", buf, /* (already includes separator) */ XLOG_SEP, plname, XLOG_SEP, tt->death); + if (multi) + Fprintf(rfile, "%cwhile=%s", XLOG_SEP, multi_reason ? multi_reason : "helpless"); Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", XLOG_SEP, encodeconduct(), XLOG_SEP, moves, XLOG_SEP, encodeachieve()); Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP,