diff --git a/Source/levels/gendung.cpp b/Source/levels/gendung.cpp index e5fe3322f..4946ea30a 100644 --- a/Source/levels/gendung.cpp +++ b/Source/levels/gendung.cpp @@ -105,7 +105,7 @@ std::optional GetSizeForThemeRoom(int floor, Point origin, int minSize, in Size room { maxWidth, maxHeight }; for (int i = 0; i < maxSize; i++) { - int width = 0; + int width = i < room.height ? i : 0; if (i < maxHeight) { while (width < room.width) { if (dungeon[origin.x + width][origin.y + i] != floor) @@ -115,7 +115,7 @@ std::optional GetSizeForThemeRoom(int floor, Point origin, int minSize, in } } - int height = 0; + int height = i < room.width ? i : 0; if (i < maxWidth) { while (height < room.height) { if (dungeon[origin.x + i][origin.y + height] != floor)