fix #H7136 - iron bars vs non-diggable walls
Iron bars can be destroyed in some circumstances (hit by yellow dragon breath or thrown potion of acid, being eaten by rust monser or black pudding, or by poly'd hero in those forms) and should act like walls for diggable/non-diggable purposes. But they aren't walls, so the non-diggable flag was not being set for them by the special level loader. Even once that was changed, they weren't being handled consistently. Some places checked for non-diggable directly (zap_over_floor of acid breath, potion of acid hitting bars) and started working as intended, others used may_dig() to check non-diggable (poly'd hero attempting to eat iron bars) but it doesn't handle iron bars, and still others didn't check at all (bars-eating monster who moved onto bars location in expectation of eating those next).
This commit is contained in:
19
src/sp_lev.c
19
src/sp_lev.c
@@ -621,6 +621,7 @@ schar filling;
|
||||
schar lit;
|
||||
{
|
||||
int x, y;
|
||||
|
||||
for (x = 2; x <= x_maze_max; x++)
|
||||
for (y = 0; y <= y_maze_max; y++) {
|
||||
SET_TYPLIT(x, y, filling, lit);
|
||||
@@ -636,11 +637,21 @@ xchar x1, y1, x2, y2;
|
||||
int prop;
|
||||
{
|
||||
register xchar x, y;
|
||||
struct rm *lev;
|
||||
|
||||
for (y = max(y1, 0); y <= min(y2, ROWNO - 1); y++)
|
||||
for (x = max(x1, 0); x <= min(x2, COLNO - 1); x++)
|
||||
if (IS_STWALL(levl[x][y].typ) || IS_TREE(levl[x][y].typ))
|
||||
levl[x][y].wall_info |= prop;
|
||||
x1 = max(x1, 1);
|
||||
x2 = min(x2, COLNO - 1);
|
||||
y1 = max(y1, 0);
|
||||
y2 = min(y2, ROWNO - 1);
|
||||
for (y = y1; y <= y2; y++)
|
||||
for (x = x1; x <= x2; x++) {
|
||||
lev = &levl[x][y];
|
||||
if (IS_STWALL(lev->typ) || IS_TREE(lev->typ)
|
||||
/* 3.6.2: made iron bars eligible to be flagged nondiggable
|
||||
(checked by chewing(hack.c) and zap_over_floor(zap.c)) */
|
||||
|| lev->typ == IRONBARS)
|
||||
lev->wall_info |= prop;
|
||||
}
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
|
||||
Reference in New Issue
Block a user