From 79ced450e75b7eb74f16867d0f6d9c49ab89ce4d Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 7 Dec 2006 06:28:16 +0000 Subject: [PATCH] engraving in inaccessible locations 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 | 1 + src/engrave.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index deb91b9ab..75733ed1a 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -286,6 +286,7 @@ suppress "you rise from the dead" if game ends due to be turned into slime don't give erroneous " 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 diff --git a/src/engrave.c b/src/engrave.c index aec61a7d0..39405ffaf 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -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!"); -- 2.40.0