]> granicus.if.org Git - nethack/commitdiff
Changes to be committed:
authornhmall <mjnh@persona.ca>
Sun, 5 Apr 2015 04:20:42 +0000 (00:20 -0400)
committernhmall <mjnh@persona.ca>
Sun, 5 Apr 2015 04:20:42 +0000 (00:20 -0400)
modified:   src/shknam.c
modified:   src/trap.c
modified:   src/zap.c

While polymorph was clearing the name because poly_obj
actually creates a brand new obj and copies field values
over, water_damage does not so the name persisted on
the blank spellbook. In this case, that isn't really
appropriate. Clear the name.

Ensure that cancellation has no effect on these
ordinary books.

Make the second-hand bookstore an option for holding
the book tribute item too.

src/shknam.c
src/trap.c
src/zap.c

index a8e08c0f010286f26a10b51ff701723c07859028..eaba1ac368e3b2b5ee98d07c4b2ff3529acec184 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.5 shknam.c        $NHDT-Date$  $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 shknam.c        $NHDT-Date: 1428207608 2015/04/05 04:20:08 $  $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.32 $ */
 /* NetHack 3.5 shknam.c        $Date: 2011/04/15 01:55:42 $  $Revision: 1.24 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -368,7 +368,8 @@ boolean mkspecl;
        struct permonst *ptr;
 
        /* 3.6.0 tribute */
-       if (mkspecl && !strcmp(shp->name, "rare books")) {
+       if (mkspecl && (!strcmp(shp->name, "rare books") ||
+                       !strcmp(shp->name, "second-hand bookstore"))) {
            struct obj *novel=mksobj_at(SPE_NOVEL, sx, sy, FALSE, FALSE);
            if (novel) context.tribute.bookstock = TRUE;
            return;
index c826fb85169ce98812c6f095edc9fc440bd8bb8b..e1a63b64dcc80d7a487c9e162f9bed19d4c068bd 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.5 trap.c  $NHDT-Date: 1427934551 2015/04/02 00:29:11 $  $NHDT-Branch: master $:$NHDT-Revision: 1.223 $ */
+/* NetHack 3.5 trap.c  $NHDT-Date: 1428207616 2015/04/05 04:20:16 $  $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.224 $ */
 /* NetHack 3.5 trap.c  $Date: 2013/03/14 01:58:21 $  $Revision: 1.179 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -3206,6 +3206,10 @@ boolean force;
                         pline("Steam rises from %s.", the(xname(obj)));
                         return 0;
                 }
+                if (obj->otyp == SPE_NOVEL) {
+                       obj->novelidx = 0;
+                       free_oname(obj);
+                } 
                 obj->otyp = SPE_BLANK_PAPER;
                 obj->dknown = 0;
                 if (carried(obj))
index 2852cf9957acddbdd63e65f4fb4d0a0d3ce4f214..a2041199fe12c935c43ad3b869aa1660b5b7b655 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1,4 +1,4 @@
-/* NetHack 3.5 zap.c   $NHDT-Date: 1427782839 2015/03/31 06:20:39 $  $NHDT-Branch: master $:$NHDT-Revision: 1.200 $ */
+/* NetHack 3.5 zap.c   $NHDT-Date: 1428207622 2015/04/05 04:20:22 $  $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.215 $ */
 /* NetHack 3.5 zap.c   $Date: 2013/11/05 00:57:56 $  $Revision: 1.183 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -956,7 +956,9 @@ register struct obj *obj;
                obj->spe = 0;
                break;
              case SPBOOK_CLASS:
-               if (otyp != SPE_CANCELLATION && otyp != SPE_BOOK_OF_THE_DEAD) {
+               if (otyp != SPE_CANCELLATION &&
+                       otyp != SPE_NOVEL &&
+                       otyp != SPE_BOOK_OF_THE_DEAD) {
                    costly_alteration(obj, COST_CANCEL);
                    obj->otyp = SPE_BLANK_PAPER;
                }