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 <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.)
This commit is contained in:
nethack.rankin
2012-04-06 08:49:27 +00:00
parent b3e131e914
commit e46e3668b3
2 changed files with 6 additions and 1 deletions

View 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

View File

@@ -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);
}