]> granicus.if.org Git - nethack/commitdiff
engraving in inaccessible locations
authornethack.rankin <nethack.rankin>
Thu, 7 Dec 2006 06:28:16 +0000 (06:28 +0000)
committernethack.rankin <nethack.rankin>
Thu, 7 Dec 2006 06:28:16 +0000 (06:28 +0000)
     Also from the newsgroup (2nd from "Three bugfixes for Xorns" [I got
the subject wrong on the previous spell of protection patch]):  when
phazing through walls or rock you could engrave as if it was ordinary
floor.  Again I didn't use the user's patch; it left closed doors, raised
drawbridge, and iron bars as locations where engraving was still feasible
and said "you can't write in solid rock" even if you were inside a tree.
[The 3rd of "3 xorn fixes" was for misleading feedback when attempting to
engrave while underwater; we've already fixed that one.]

     There was a suggestion that you should be able to engrave within solid
rock if you use a wand of digging, and that seems like a pretty good idea,
but the check for location comes before the check for writing instrument so
would be tricky to implement.

doc/fixes34.4
src/engrave.c

index deb91b9ab8e49cce5f9c4e0da8599969a0030d5b..75733ed1a9894f2f85e908418be8329e681a31d9 100644 (file)
@@ -286,6 +286,7 @@ suppress "you rise from the dead" if game ends due to be turned into slime
 don't give erroneous "<mon> disppears" message for hero poly'd into quantum
        mechanic who hits engulfer while swallowed and blinded
 feedback from casting spell of protection was wrong in some situations
+can't engrave on floor while inside solid rock, wall, or closed door
 
 
 Platform- and/or Interface-Specific Fixes
index aec61a7d0779ea6a9c223c49de3388e468145c28..39405ffaf66b9dcc68297fbc407bb88d69fa0ccb 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)engrave.c  3.5     2005/06/22      */
+/*     SCCS Id: @(#)engrave.c  3.5     2006/12/06      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -499,6 +499,10 @@ doengrave()
        if(Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)/* in bubble */) {
                You_cant("write in thin air!");
                return(0);
+       } else if (closed_door(u.ux, u.uy) || !accessible(u.ux, u.uy)) {
+               /* stone, tree, wall, secret corridor, pool, lava, bars */
+               You_cant("write here.");
+               return 0;
        }
        if (cantwield(youmonst.data)) {
                You_cant("even hold anything!");