]> granicus.if.org Git - nethack/commitdiff
stealing heaven
authornethack.rankin <nethack.rankin>
Thu, 21 Nov 2002 00:47:12 +0000 (00:47 +0000)
committernethack.rankin <nethack.rankin>
Thu, 21 Nov 2002 00:47:12 +0000 (00:47 +0000)
     Fix the reported problem of getting impossible warnings for unpaid
inventory items during final disclosure if you level teleport out of
the dungeon while holding shop goods.  The fix makes you trigger a shop
robbery first; that required a minor end of game change to prevent the
shopkeeper from seeming to tag along (shk would take your possessions
as if you'd died on the shop level).

doc/fixes34.1
include/extern.h
src/end.c
src/shk.c
src/teleport.c

index 8d5d7cf4b5bc2dd4edec385a46839a410b5f1313..260d8f1d25682ed95cfb304ffaddd3ed7a6ce58a 100644 (file)
@@ -309,6 +309,8 @@ breaking wand of digging causing a shopkeeper to fall left unpaid items unpaid
 use get_adjacent_loc() rather than getdir() directly for some things where
        you want to ensure valid adjacent coordinates are returned
 minor experience calculation tweaks
+level telporting out of the dungeon while carrying unpaid shop goods would
+       trigger "not on any bill" warnings during final inventory disclosure
 
 
 Platform- and/or Interface-Specific Fixes
index a076de73ebf0210d98689755aa93e990666b71e0..58db92c4f6fba1577c36611a9925254576c842d9 100644 (file)
@@ -1762,7 +1762,7 @@ E void FDECL(make_happy_shk, (struct monst *,BOOLEAN_P));
 E void FDECL(hot_pursuit, (struct monst *));
 E void FDECL(make_angry_shk, (struct monst *,XCHAR_P,XCHAR_P));
 E int NDECL(dopay);
-E boolean FDECL(paybill, (BOOLEAN_P));
+E boolean FDECL(paybill, (int));
 E void NDECL(finish_paybill);
 E struct obj *FDECL(find_oid, (unsigned));
 E long FDECL(contained_cost, (struct obj *,struct monst *,long,BOOLEAN_P, BOOLEAN_P));
index 246f6fc8cb9cd05146b9f3cdb83e6c7d5c506a00..476a9bfacd610877b29ce601659b4f92c7aab2d0 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)end.c      3.4     2002/10/04      */
+/*     SCCS Id: @(#)end.c      3.4     2002/11/20      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -690,7 +690,7 @@ die:
 
        if (how != PANICKED) {
            /* these affect score and/or bones, but avoid them during panic */
-           taken = paybill(how != QUIT);
+           taken = paybill((how == ESCAPED) ? -1 : (how != QUIT));
            paygd();
            clearpriests();
        } else  taken = FALSE;  /* lint; assert( !bones_ok ); */
index 0c506c11c55dc5f7f3a489d107478f9cae83999d..539c66ebd1a2cb10d0f05f5eafb0cab336584642 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)shk.c      3.4     2002/09/28      */
+/*     SCCS Id: @(#)shk.c      3.4     2002/11/20      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -51,7 +51,7 @@ STATIC_DCL long FDECL(getprice, (struct obj *,BOOLEAN_P));
 STATIC_DCL void FDECL(shk_names_obj,
                 (struct monst *,struct obj *,const char *,long,const char *));
 STATIC_DCL struct obj *FDECL(bp_to_obj, (struct bill_x *));
-STATIC_DCL boolean FDECL(inherits, (struct monst *, int, BOOLEAN_P));
+STATIC_DCL boolean FDECL(inherits, (struct monst *,int,int));
 STATIC_DCL void FDECL(set_repo_loc, (struct eshk *));
 STATIC_DCL boolean NDECL(angry_shk_exists);
 STATIC_DCL void FDECL(rile_shk, (struct monst *));
@@ -1572,6 +1572,9 @@ boolean croaked;
        register boolean taken = FALSE;
        register int numsk = 0;
 
+       /* if we escaped from the dungeon, shopkeepers can't reach us */
+       if (croaked < 0) return FALSE;
+
        /* this is where inventory will end up if any shk takes it */
        repo_location.x = repo_location.y = 0;
 
@@ -1602,7 +1605,7 @@ STATIC_OVL boolean
 inherits(shkp, numsk, croaked)
 struct monst *shkp;
 int numsk;
-boolean croaked;
+int croaked;
 {
        long loss = 0L;
 #ifdef GOLDOBJ
index f53a7a0c504c6605851cc68184bdd7118dcc6680..0beb02aa14c26b13edc33995832907e0a4a158f8 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)teleport.c 3.4     2002/05/31      */
+/*     SCCS Id: @(#)teleport.c 3.4     2002/11/20      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -648,6 +648,14 @@ level_tele()
        killer = 0;             /* still alive, so far... */
 
        if (newlev < 0) {
+               if (*u.ushops0) {
+                   /* take unpaid inventory items off of shop bills */
+                   in_mklev = TRUE;    /* suppress map update */
+                   u_left_shop(u.ushops0, TRUE);
+                   /* you're now effectively out of the shop */
+                   *u.ushops0 = *u.ushops = '\0';
+                   in_mklev = FALSE;
+               }
                if (newlev <= -10) {
                        You("arrive in heaven.");
                        verbalize("Thou art early, but we'll admit thee.");
@@ -670,8 +678,8 @@ level_tele()
                    pline("Unfortunately, you don't know how to fly.");
                    You("plummet a few thousand feet to your death.");
                    Sprintf(buf,
-                               "teleported out of the dungeon and fell to %s death",
-                               uhis());
+                         "teleported out of the dungeon and fell to %s death",
+                           uhis());
                    killer = buf;
                    killer_format = NO_KILLER_PREFIX;
                }