From 1c70b6f77759be39286a05f7ca47646e59b7f1c9 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 15 Dec 2006 03:11:14 +0000 Subject: [PATCH] engraving vs drawbridge From the newsgroup: ``Something is engraved here on the water.'' An engraving written on a lowered drawbridge would be transfered to the underlying terrain when the bridge was raised. The coverse was also true; if you plugged the moat and then engraved on the ground, that engraving would remain visible--and touchable if blind--when the bridge was lowered to cover its spot. Rather than try to handle two different engravings at the same coordinates (with one of those two changing locations when the bridge is raised or lowered), this just wipes out any engraving at both span and portcullis locations whenever the bridge state changes, like is done for traps. --- doc/fixes34.4 | 1 + src/dbridge.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index e9bad3462..6bddaaafb 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -287,6 +287,7 @@ 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 +remove engravings at drawbridge location when it is opened, closed, or wrecked Platform- and/or Interface-Specific Fixes diff --git a/src/dbridge.c b/src/dbridge.c index 48d421bec..3949e4d6d 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dbridge.c 3.5 2005/12/05 */ +/* SCCS Id: @(#)dbridge.c 3.5 2006/12/13 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -8,6 +8,13 @@ * * Added comprehensive monster-handling, and the "entity" structure to * deal with players as well. - 11/89 + * + * Any traps and/or engravings at either the portcullis or span location + * are destroyed whenever the bridge is lowered, raised, or destroyed. + * (Engraving handling could be extended to flag whether an engraving on + * the DB_UNDER surface is hidden by the lowered bridge, or one on the + * bridge itself is hidden because the bridge has been raised, but that + * seems like an awful lot of effort for very little gain.) */ #include "hack.h" @@ -778,6 +785,8 @@ int x,y; delallobj(x2, y2); if ((t = t_at(x, y)) != 0) deltrap(t); if ((t = t_at(x2, y2)) != 0) deltrap(t); + del_engr_at(x, y); + del_engr_at(x2, y2); newsym(x, y); newsym(x2, y2); block_point(x2,y2); /* vision */ @@ -817,6 +826,8 @@ int x,y; delallobj(x, y); if ((t = t_at(x, y)) != 0) deltrap(t); if ((t = t_at(x2, y2)) != 0) deltrap(t); + del_engr_at(x, y); + del_engr_at(x2, y2); newsym(x, y); newsym(x2, y2); unblock_point(x2,y2); /* vision */ @@ -882,6 +893,8 @@ int x,y; lev2->doormask = D_NODOOR; if ((t = t_at(x, y)) != 0) deltrap(t); if ((t = t_at(x2, y2)) != 0) deltrap(t); + del_engr_at(x, y); + del_engr_at(x2, y2); for (i = rn2(6); i > 0; --i) { /* scatter some debris */ /* doesn't matter if we happen to pick or ; since drawbridges are never placed diagonally, those -- 2.40.0