]> granicus.if.org Git - nethack/commitdiff
fix #H4336 - extra space in potions boil message
authorPatR <rankin@nethack.org>
Sat, 7 May 2016 23:24:17 +0000 (16:24 -0700)
committerPatR <rankin@nethack.org>
Sat, 7 May 2016 23:24:17 +0000 (16:24 -0700)
'Your <single-potion> boils and explodes.'
'One of your <stack-of-potions> boils and explodes.'
'Some of your <stack-of-potions> boil and explode.'
'All of your  <stack-of-potions> boil and explode.'
The last variation had an extra space in the message prefix....

In addition to removing the excess space, this adds
'Both of your <stack-of-potions> boil and explode.'
to be used for the (All == 2) case.

The bug and fix also apply to stacks of potions 'freezing and
shattering' and to stacks of scrolls 'catching fire and burning'.

doc/fixes36.1
src/zap.c

index 724ed89d5ef20e9171533057c1036a7550d5322a..2af5329132403625c35a9e1330c0f216ff759c10 100644 (file)
@@ -228,6 +228,8 @@ when feel_location removed a remembered-unseen-monster glyph from a known
        water location while hero was levitating, the map was redrawn showing
        floor instead of water at that spot
 Vlad's tower2 and tower3 didn't show up in wizard-mode ^O output or ^V? menu
+remove extra space from "All of your  <stack-of-potions> boil and explode."
+       (also applies to potions freezing and to scrolls burning)
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Respository
index 21d683e487e6a256e421919e89b4591d4c415546..b0a182873c51281365ad86892b31fec7b5e99c0d 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 zap.c   $NHDT-Date: 1461028544 2016/04/19 01:15:44 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.251 $ */
+/* NetHack 3.6 zap.c   $NHDT-Date: 1462663451 2016/05/07 23:24:11 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.252 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -4706,9 +4706,12 @@ register int osym, dmgtyp;
 
             if (!cnt)
                 continue;
-            mult = (cnt == quan)
-                       ? (quan > 1) ? "All of your " : "Your"
-                       : (cnt == 1L) ? "One of your" : "Some of your";
+            mult = (cnt == 1L)
+                   ? (quan == 1L) ? "Your"                        /* 1 of 1 */
+                                  : "One of your"                 /* 1 of N */
+                   : (cnt < quan) ? "Some of your"                /* n of N */
+                                  : (quan == 2L) ? "Both of your" /* 2 of 2 */
+                                                 : "All of your"; /* N of N */
             pline("%s %s %s!", mult, xname(obj),
                   destroy_strings[dindx][(cnt > 1L)]);
             if (osym == POTION_CLASS && dmgtyp != AD_COLD) {