fix #2253 - shk dismissing kops from other level (trunk only)

From a bug report, if you rob a shop, let the
angry shopkeeper catch up with you outside his shop, escape to another
level with adjacent shk tagging along, then pacify the shk by paying him
off, he will dismiss kops on the present level and return to his shop
but when you return to his shop level there'll still be kops chasing you
there.  This fix adds an extra flag to the eshk structure so that kops
can be dismissed a second time when the shk migrates back to shop level.
The first dismisal (on the "wrong" level) still takes place in case any
kops are around.  Neither dismissal actually occurs if there happens to
be another angry shk present on the level where dismissal is being done.
This commit is contained in:
nethack.rankin
2011-04-15 01:55:42 +00:00
parent 7002734ca5
commit 8df1e4d6cb
6 changed files with 78 additions and 21 deletions

View File

@@ -1019,13 +1019,23 @@ register boolean silentkops;
/* arrive near shop's door */
migrate_to_level(shkp, ledger_no(&eshkp->shoplevel),
MIGR_APPROX_XY, &eshkp->shd);
/* dismiss kops on that level when shk arrives */
eshkp->dismiss_kops = TRUE;
}
if (vanished)
pline("Satisfied, %s suddenly disappears!", shk_nam);
} else if(wasmad)
pline("%s calms down.", Monnam(shkp));
if(!angry_shk_exists()) {
make_happy_shoppers(silentkops);
}
/* called by make_happy_shk() and also by losedogs() for migrating shk */
void
make_happy_shoppers(silentkops)
boolean silentkops;
{
if (!angry_shk_exists()) {
#ifdef KOPS
kops_gone(silentkops);
#endif