when taming is used to pacify hostile shopkeeper. I haven't
figured out how to reproduce and eliminate the double dismissal,
but this will prevent the second one from issuing duplicate "the
Kops (disappointed) vanish into thin air" and also from trigging
the warning "dmonsfree: N removed doesn't match 2N pending."
The first dismissal leaves defunct Kops on the monster list, as
expected; second dismissal found them still there and sent them
away again instead of skipping them as already gone.
-/* NetHack 3.7 shk.c $NHDT-Date: 1607754748 2020/12/12 06:32:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.193 $ */
+/* NetHack 3.7 shk.c $NHDT-Date: 1610667899 2021/01/14 23:44:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.195 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
kops_gone(silent)
boolean silent;
{
- register int cnt = 0;
- register struct monst *mtmp, *mtmp2;
+ int cnt = 0;
+ struct monst *mtmp, *mtmp2;
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
mtmp2 = mtmp->nmon;
+ if (DEADMONSTER(mtmp))
+ continue;
if (mtmp->data->mlet == S_KOP) {
if (canspotmon(mtmp))
cnt++;