fix #K3912 - engraving sanity: closed doors

Engraving in an empty doorway and then using locking magic to create
a door there resulted in an impossible warning: "engraving sanity:
illegal surface (23)" if the 'sanity_check' option was On (wizard
mode only).  Engraving in an open doorway and then simply closing
the existing door produced the same effect.

Accept engravings at closed doors.  Presumably hero will be using
Passes_walls to attempt that so treat closed doors same as open ones.
Update the engraving sanity check to deal with that.

Bonus fix: engraving sanity checking stopped after the first problem
instead of checking every engraving.  Have it continue instead.

Not fixed:  vault wall repair and temporary corridor removal does
not delete engravings and can trigger the illegal surface warning if
player engraves before the repairs.  I didn't test shop wall repair
but it doesn't have any engr references so probably has the same bug.
This commit is contained in:
PatR
2023-05-03 14:29:03 -07:00
parent 53adba6602
commit c0441126b8
5 changed files with 47 additions and 28 deletions

View File

@@ -107,6 +107,14 @@ enum levl_typ_types {
#define IS_AIR(typ) ((typ) == AIR || (typ) == CLOUD)
#define IS_SOFT(typ) ((typ) == AIR || (typ) == CLOUD || IS_POOL(typ))
#define IS_WATERWALL(typ) ((typ) == WATER)
/* for surface checks when it's unknown whether a drawbridge is involved;
drawbridge_up is the spot in front of a closed drawbridge and not the
current surface at that spot; caveat: this evaluates its arguments more
than once and might make a function call */
#define SURFACE_AT(x,y) \
((levl[x][y].typ == DRAWBRIDGE_UP) \
? db_under_typ(levl[x][y].drawbridgemask) \
: levl[x][y].typ)
/*
* Note: secret doors (SDOOR) want to use both rm.doormask and