]> granicus.if.org Git - nethack/commitdiff
inappropriate pacification of shopkeepers
authorcohrs <cohrs>
Fri, 12 Sep 2003 17:23:04 +0000 (17:23 +0000)
committercohrs <cohrs>
Fri, 12 Sep 2003 17:23:04 +0000 (17:23 +0000)
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 <Someone>'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
src/shk.c

index 5dc45d419e30ef160cfb8aeae8d321e3faaa1162..c61444444f0ffa15aa9705330ca76a696742d6c0 100644 (file)
@@ -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
index eb80d46e2a03f762ce594d2bf8c32c9c7043bae4..32568d3dd165d023ac4377f302e0c412b224c6cb 100644 (file)
--- 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;