Don't pay the shopkeeper when displacing a pet in a shop

The recent commit to interpret walking into a shopkeeper as a "pay"
command was triggering in too many circumstances. Check to ensure
that the monster that we're walking into is a known shopkeeper
before activating the special case.
This commit is contained in:
Alex Smith
2023-12-09 02:03:31 +00:00
parent a6985b1f1a
commit cb1eadd6b7

View File

@@ -479,7 +479,8 @@ do_attack(struct monst *mtmp)
char buf[BUFSZ];
if (!gc.context.travel && !gc.context.run)
return ECMD_TIME | dopay();
if (canspotmon(mtmp) && mtmp->isshk)
return ECMD_TIME | dopay();
if (mtmp->mtame) /* see 'additional considerations' above */
monflee(mtmp, rnd(6), FALSE, FALSE);