]> granicus.if.org Git - nethack/commitdiff
fix another part of #2629 - destory_mitem of partial stack (trunk only)
authornethack.rankin <nethack.rankin>
Fri, 6 Apr 2012 08:49:27 +0000 (08:49 +0000)
committernethack.rankin <nethack.rankin>
Fri, 6 Apr 2012 08:49:27 +0000 (08:49 +0000)
     From a bug report, if part of a stack in a monster's inventory gets
destroyed (examples given were from Fire Brand burning scrolls or Frost
Brand freezing potions, but other code calls destroy_mitem() too), the
message handled singular vs plural for the desruction part ("catches
fire and burns" vs "catch fire and burn") but always used plural when
formatting the object stack being affected.  Now say "One of <the mon's
foo>" or "Some of <the mon's foo>" as appropriate when part of a stack
is being destroyed.  (destroy_item() for the hero paid more attention
and handled this issue correctly.)

doc/fixes35.0
src/zap.c

index ac621921e55ce8402ee397eb95b797efb1e53f1c..235fd824087bf726459a43f6d456a43b6e3a1b0b 100644 (file)
@@ -412,6 +412,8 @@ theft of worn armor with wear/unwear delay would interfere with completion of
 alchemical explosion or evaporation only used up one potion instead of all
        the potions being dipped
 feedback for reverse-genocide was plural even when just one monster was created
+fix message given when part of a stack of items in a monster's inventory is
+       being destroyed
 
 
 Platform- and/or Interface-Specific Fixes
index 3e51d5b0b15dda29da56019df4bf1cf755e9404a..644da6619dad9dbf34e3867801efdaa23b824162 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -4587,7 +4587,10 @@ int osym, dmgtyp;
                    if(!rn2(3)) cnt++;
 
                if(!cnt) continue;
-               if (vis) pline("%s %s!", Yname2(obj),
+               if (vis) pline("%s%s %s!",
+                              (cnt == obj->quan) ? "" :
+                                (cnt > 1L) ? "Some of " : "One of ",
+                              (cnt == obj->quan) ? Yname2(obj) : yname(obj),
                               destroy_strings[dindx][(cnt > 1L)]);
                for(i = 0; i < cnt; i++) m_useup(mtmp, obj);
            }