From 3113387371a98e085782bfbba21dfc6a8d23767d Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 7 Nov 2025 13:03:46 -0800 Subject: [PATCH] fix #S14667 - livelog of genocide when hallucinating Uncursed genocide while hallucinating deliberately reports hero's role to the player as the affected target, but it was also showing that for livelog and #chronicle. Making the true target be visible for #chronicle gives away a little information but that should be inconsequential in this siutation since the player specifies the target. Not sure why this report got misclassified as spam. --- doc/fixes3-7-0.txt | 4 +++- src/read.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 040600e43..f8aa94516 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1535 $ $NHDT-Date: 1740629713 2025/02/26 20:15:13 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1572 $ $NHDT-Date: 1762577372 2025/11/07 20:49:32 $ General Fixes and Modified Features ----------------------------------- @@ -2825,6 +2825,8 @@ archeologists' fedora is lucky telepathic hero can discern which particular monster just read a scroll add "make fetch-docs" to download pre-formatted documentation monsters will use throw-and-return weapons such as an aklys +uncursed genocide while hallucinating deliberately mis-reports hero's role as + target but was also inappropriately showing it to livelog/#chronicle Platform- and/or Interface-Specific New Features diff --git a/src/read.c b/src/read.c index 5ebe8ab64..2fd2c98ba 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 read.c $NHDT-Date: 1715889745 2024/05/16 20:02:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.308 $ */ +/* NetHack 3.7 read.c $NHDT-Date: 1762577372 2025/11/07 20:49:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.323 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2755,7 +2755,7 @@ do_genocide( * 3 = forced genocide of player * 5 (4 | 1) = normal genocide from throne */ { - char buf[BUFSZ], promptbuf[QBUFSZ]; + char buf[BUFSZ], realbuf[BUFSZ], promptbuf[QBUFSZ]; int i, killplayer = 0; int mndx; struct permonst *ptr; @@ -2860,27 +2860,27 @@ do_genocide( } which = "all "; + Strcpy(buf, ptr->pmnames[NEUTRAL]); /* standard singular */ + if ((ptr->geno & G_UNIQ) && ptr != &mons[PM_HIGH_CLERIC]) + which = !type_is_pname(ptr) ? "the " : ""; + Strcpy(realbuf, buf); /* save true name, to avoid Hallu for livelog */ if (Hallucination) { - if (Upolyd) + if (Upolyd) { Strcpy(buf, pmname(gy.youmonst.data, flags.female ? FEMALE : MALE)); - else { + } else { Strcpy(buf, (flags.female && gu.urole.name.f) ? gu.urole.name.f : gu.urole.name.m); buf[0] = lowc(buf[0]); } - } else { - Strcpy(buf, ptr->pmnames[NEUTRAL]); /* standard singular */ - if ((ptr->geno & G_UNIQ) && ptr != &mons[PM_HIGH_CLERIC]) - which = !type_is_pname(ptr) ? "the " : ""; } if (how & REALLY) { if (!num_genocides()) livelog_printf(LL_CONDUCT | LL_GENOCIDE, "performed %s first genocide (%s)", - uhis(), makeplural(buf)); + uhis(), makeplural(realbuf)); else - livelog_printf(LL_GENOCIDE, "genocided %s", makeplural(buf)); + livelog_printf(LL_GENOCIDE, "genocided %s", makeplural(realbuf)); /* setting no-corpse affects wishing and random tin generation */ svm.mvitals[mndx].mvflags |= (G_GENOD | G_NOCORPSE);