fix github issue #606 - shop wall repair
triggering an impossible warning about "wall_angle: unknown" due to the known conflict between door state and wall info which both overlay the flags field for map locations. Reported and diagnosed by vultur-cadens: if a shop's wall was dug open, followed by use of locking magic to plug the gap with a door, and then unlocking that door, the D_CLOSED door flag was left as invalid wall_info when shop damage was repaired. Map re-display complained. Leaving the door locked or opening it after unlocking did not result in any complaint because the values for those door states do not conflict with wall angle values. The problem was reproducible and is now fixed by adding an extra field to the shop damage structure. A similar change has been made to the vault guard's 'fake corridor' structure but I have no test case for that so don't know whether it makes any difference. At least it doesn't seem to have broken anything. Existing save and bones files are invalidated by the fixes. Fixes #606
This commit is contained in:
@@ -2971,16 +2971,44 @@ t_warn(struct rm *lev)
|
||||
static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x";
|
||||
const char *wname;
|
||||
|
||||
if (lev->typ == TUWALL)
|
||||
/* 3.7: non-T_wall cases added after shop repair (via breaching a wall,
|
||||
using locking magic to put a door there, then unlocking the door;
|
||||
D_CLOSED carried over to the wall) triggered warning for "unknown" */
|
||||
switch (lev->typ) {
|
||||
case TUWALL:
|
||||
wname = "tuwall";
|
||||
else if (lev->typ == TLWALL)
|
||||
break;
|
||||
case TLWALL:
|
||||
wname = "tlwall";
|
||||
else if (lev->typ == TRWALL)
|
||||
break;
|
||||
case TRWALL:
|
||||
wname = "trwall";
|
||||
else if (lev->typ == TDWALL)
|
||||
break;
|
||||
case TDWALL:
|
||||
wname = "tdwall";
|
||||
else
|
||||
break;
|
||||
case VWALL:
|
||||
wname = "vwall";
|
||||
break;
|
||||
case HWALL:
|
||||
wname = "hwall";
|
||||
break;
|
||||
case TLCORNER:
|
||||
wname = "tlcorner";
|
||||
break;
|
||||
case TRCORNER:
|
||||
wname = "trcorner";
|
||||
break;
|
||||
case BLCORNER:
|
||||
wname = "blcorner";
|
||||
break;
|
||||
case BRCORNER:
|
||||
wname = "brcorner";
|
||||
break;
|
||||
default:
|
||||
wname = "unknown";
|
||||
break;
|
||||
}
|
||||
impossible(warn_str, wname, lev->wall_info & WM_MASK,
|
||||
(unsigned int) lev->seenv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user