From 4ab1c12f030ef1f2f767152cde649e3ee4f3bbf8 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 29 Nov 2018 10:24:50 -0800 Subject: [PATCH] fix github issue #164 - lack of steed-in-pit mesg Fixes #164 No message was shown when riding a steed into a pit or spiked pit. Setup for the message was done, but post-3.4.3 insertion of else-if into the previous if/else/endif cut off its delivery. --- doc/fixes36.2 | 1 + src/trap.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 7ecb9d247..3acebaa54 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -228,6 +228,7 @@ for configurations with 'long int' larger than 'int', lev_comp wrote some stinking cloud placed near water could kill underwater creatures applying--rather than wielding--a cursed polearm or weapon-tool didn't report that it had become welded to hero's hand(s) +the message when riding a steed into a pit was composed but not shown Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/trap.c b/src/trap.c index d43117e43..d8d4018e7 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1543100476 2018/11/24 23:01:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.311 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1543515862 2018/11/29 18:24:22 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.312 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1185,6 +1185,7 @@ unsigned trflags; if (!Sokoban) { char verbbuf[BUFSZ]; + *verbbuf = '\0'; if (u.usteed) { if ((trflags & RECURSIVETRAP) != 0) Sprintf(verbbuf, "and %s fall", @@ -1202,8 +1203,9 @@ unsigned trflags; } else { Strcpy(verbbuf, !plunged ? "fall" : (Flying ? "dive" : "plunge")); - You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]); } + if (*verbbuf) + You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]); } /* wumpus reference */ if (Role_if(PM_RANGER) && !trap->madeby_u && !trap->once