From: nethack.rankin Date: Fri, 6 Apr 2012 08:35:00 +0000 (+0000) Subject: fix part of #2629 - feedback for reverse genocide (trunk only) X-Git-Tag: MOVE2GIT~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3e131e91402d9c2dee8dc60ca230728097a56c1;p=nethack fix part of #2629 - feedback for reverse genocide (trunk only) From a bug report, if reading a cursed scroll of genocide created only one monster it would give the plural message "Sent in some ." Now it will say "Sent in a(n) ." in such case. (The grammar is accurate even if you can't see what happened; that situation is unusual enough that I'm not going to worry about giving information away.) --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index a4e6b1bd2..ac621921e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -411,6 +411,7 @@ theft of worn armor with wear/unwear delay would interfere with completion of #sit while swallowed would give the wrong message 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 Platform- and/or Interface-Specific Fixes diff --git a/src/read.c b/src/read.c index a4eda1fe9..686a837b1 100644 --- a/src/read.c +++ b/src/read.c @@ -1934,7 +1934,7 @@ int how; kill_genocided_monsters(); update_inventory(); /* in case identified eggs were affected */ } else { - int cnt = 0; + int cnt = 0, census = monster_census(FALSE); if (!(mons[mndx].geno & G_UNIQ) && !(mvitals[mndx].mvflags & (G_GENOD | G_EXTINCT))) @@ -1945,9 +1945,13 @@ int how; if (mvitals[mndx].mvflags & G_EXTINCT) break; /* just made last one */ } - if (cnt) - pline("Sent in some %s.", makeplural(buf)); - else + if (cnt) { + /* accumulated 'cnt' doesn't take groups into account; + assume bringing in new mon(s) didn't remove any old ones */ + cnt = monster_census(FALSE) - census; + pline("Sent in %s%s.", (cnt > 1) ? "some " : "", + (cnt > 1) ? makeplural(buf) : an(buf)); + } else pline1(nothing_happens); } }