From 8396866296f5358754dee2562ee651c62be7b29a Mon Sep 17 00:00:00 2001 From: cohrs Date: Fri, 12 Sep 2003 17:23:04 +0000 Subject: [PATCH] inappropriate pacification of shopkeepers A recent report noted that if you are invisible, teleport into a shop, steal something, teleport out, and then return, the shopkeeper will become pacified. This is because the pacification code occurred even if the shopkeeper already knew your name, as long as the "Welcome" message had not yet occurred. Implement 's proposed fix: Before pacifying, either the visitct must be zero (as per old code) or the customer name must already be known. And, of course, the customer name must differ from the current setting. This skips the pacification code in those situations where the shopkeeper learned your name but was not happy about it (which is what visitct > 0 implies, at least initially). This also deals with an older bug report where you attack a shopkeeper while outside the shop and then later enter the shop while the shopkeeper is in it. hot_pursuit() sets the customer name, and the new check avoids pacifying the shopkeeper for the same reason as noted above. --- doc/fixes34.3 | 2 ++ src/shk.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 5dc45d419..c61444444 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -17,6 +17,8 @@ approaching Medusa while having reflection+invisibility+esp would cause her to turn herself to stone if you happened to be blind at the time Master Kaen's death message was not appropriate missing fountain tag in minend-3 +do not pacify shopkeeper when the hero enters a shop if that hero previously + angered the shopkeeper without ever visibly entering the shop Platform- and/or Interface-Specific Fixes diff --git a/src/shk.c b/src/shk.c index eb80d46e2..32568d3dd 100644 --- a/src/shk.c +++ b/src/shk.c @@ -522,7 +522,8 @@ register char *enterstring; eshkp->bill_p = &(eshkp->bill[0]); - if (!eshkp->visitct || strncmpi(eshkp->customer, plname, PL_NSIZ)) { + if ((!eshkp->visitct || *eshkp->customer) && + strncmpi(eshkp->customer, plname, PL_NSIZ)) { /* You seem to be new here */ eshkp->visitct = 0; eshkp->following = 0; -- 2.40.0