diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 7d94ac579..9fd4f3aa0 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -83,6 +83,8 @@ succubus/incubus seduction might result in loss of levitation which in turn fix hole/trapdoor passage inconsistency when polymorphed into a giant making a wide-open special level with FLAGS:inaccessibles could trigger a "floodfill stack overrun" panic (no 3.6.x levels were affected) +wallifying a special level might go out of map bounds (not with 3.6.x levels) + and corrupt other level data Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/sp_lev.c b/src/sp_lev.c index b1fd86086..af1cdc678 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2552,19 +2552,23 @@ region *tmpregion; } } -void +STATIC_OVL void wallify_map(x1, y1, x2, y2) int x1, y1, x2, y2; { int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy; + y1 = max(y1, 0); + x1 = max(x1, 1); + y2 = min(y2, ROWNO - 1); + x2 = min(x2, COLNO - 1); for (y = y1; y <= y2; y++) { lo_yy = (y > 0) ? y - 1 : 0; hi_yy = (y < y2) ? y + 1 : y2; for (x = x1; x <= x2; x++) { if (levl[x][y].typ != STONE) continue; - lo_xx = (x > 0) ? x - 1 : 0; + lo_xx = (x > 1) ? x - 1 : 1; hi_xx = (x < x2) ? x + 1 : x2; for (yy = lo_yy; yy <= hi_yy; yy++) for (xx = lo_xx; xx <= hi_xx; xx++)