]> granicus.if.org Git - nethack/commitdiff
shopkeeper falling thru a hole left unpaid objects unpaid
authorcohrs <cohrs>
Fri, 15 Nov 2002 07:32:52 +0000 (07:32 +0000)
committercohrs <cohrs>
Fri, 15 Nov 2002 07:32:52 +0000 (07:32 +0000)
Reported to the list.  Player breaks a wand of digging causing the
shopkeeper to fall.  This didn't clear unpaid items.  For now, this can
only occur due to player action, so added a call to make_angry_shk to
handle this situation.

doc/fixes34.1
src/dig.c
src/shk.c

index 1574b4a27e01f69efa5ee826a28d15aa32216cfa..52da83b554cf28ac52ee15bd5642815216fa3d7f 100644 (file)
@@ -305,6 +305,7 @@ all objects carried by a monster who's hit by a polymorph zap are protected
        from that zap, not just worn armor which falls off due to shape change
 sparkle option for display effects was ignored on explosions
 level teleport while on a sleeping steed caused panic and possible crash
+breaking wand of digging causing a shopkeeper to fall left unpaid items unpaid
 
 
 Platform- and/or Interface-Specific Fixes
index 6f92a7181d17216855ff0a234727e835e5ac5cbe..90dab741eb618fcf33e0f24e88fa48261f5d3be9 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -632,6 +632,7 @@ int ttyp;
                        } else {
                            get_level(&tolevel, depth(&u.uz) + 1);
                        }
+                       if (mtmp->isshk) make_angry_shk(mtmp, 0, 0);
                        migrate_to_level(mtmp, ledger_no(&tolevel),
                                         MIGR_RANDOM, (coord *)0);
                    }
index a99408a39db197f874725c360d9bdf0e3290ee6b..7974e75ed870f09897c86665a137845c6c4cbd25 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1000,7 +1000,7 @@ register struct monst *shkp;
        ESHK(shkp)->following = 1;
 }
 
-/* used when the shkp is teleported out of his shop,
+/* used when the shkp is teleported or falls (ox == 0) out of his shop,
  * or when the player is not on a costly_spot and he
  * damages something inside the shop.  these conditions
  * must be checked by the calling function.
@@ -1027,7 +1027,7 @@ register xchar ox,oy;
           which makes this message look pretty silly, so temporarily restore
           her original location during the call to Monnam. */
        sx = shkp->mx,  sy = shkp->my;
-       if (cansee(ox, oy) && !cansee(sx, sy))
+       if (isok(ox, oy) && cansee(ox, oy) && !cansee(sx, sy))
                shkp->mx = ox,  shkp->my = oy;
        pline("%s %s!", Monnam(shkp),
              !ANGRY(shkp) ? "gets angry" : "is furious");