From: nhmall Date: Sun, 5 Apr 2015 04:20:42 +0000 (-0400) Subject: Changes to be committed: X-Git-Tag: NetHack-3.6.0_RC01~480^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e74df8b088614f282c21fc084fb1b93ab5435b1;p=nethack Changes to be committed: 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. --- diff --git a/src/shknam.c b/src/shknam.c index a8e08c0f0..eaba1ac36 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -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; diff --git a/src/trap.c b/src/trap.c index c826fb851..e1a63b64d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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)) diff --git a/src/zap.c b/src/zap.c index 2852cf995..a2041199f 100644 --- 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; }