1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-30 01:12:25 +01:00

Merge pull request #1352 from NeroOneTrueKing/patch-fix-maze_add_rooms-impossible

Fix mazerooms being unable to place a door
This commit is contained in:
Chris-plus-alphanumericgibberish 2020-12-29 00:02:32 -05:00 committed by GitHub
commit 9b940dc3a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -947,7 +947,14 @@ int maxsize;
hy = roompos.y + height;
/* validate location */
if (!rectangle_in_mazewalk_area(lx, ly, hx, hy)) {
if (!rectangle_in_mazewalk_area(lx, ly, hx, hy) || /* room itself has to fit */
(
/* a slightly larger room must also fit, to guarantee we can connect it into the larger maze */
!rectangle_in_mazewalk_area(lx - 2, ly, hx, hy) &&
!rectangle_in_mazewalk_area(lx, ly - 2, hx, hy) &&
!rectangle_in_mazewalk_area(lx, ly, hx + 2, hy) &&
!rectangle_in_mazewalk_area(lx, ly, hx, hy + 2)
)) {
/* can't place, out of bounds */
continue;
}