From: nethack.rankin Date: Fri, 6 Apr 2012 08:49:27 +0000 (+0000) Subject: fix another part of #2629 - destory_mitem of partial stack (trunk only) X-Git-Tag: MOVE2GIT~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e46e3668b375096fc564f6e6c2b66ed2ab38ce97;p=nethack fix another part of #2629 - destory_mitem of partial stack (trunk only) 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 " or "Some of " as appropriate when part of a stack is being destroyed. (destroy_item() for the hero paid more attention and handled this issue correctly.) --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index ac621921e..235fd8240 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -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 diff --git a/src/zap.c b/src/zap.c index 3e51d5b0b..644da6619 100644 --- 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); }