]> granicus.if.org Git - nethack/commitdiff
Fix ancient subroom location bug
authorPasi Kallinen <paxed@alt.org>
Mon, 23 Jan 2023 17:41:29 +0000 (19:41 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 23 Jan 2023 17:50:37 +0000 (19:50 +0200)
Randomly placed subrooms were never generated touching
the right or bottom walls of the parent room.

This bug has been present since at least 3.1.0

dat/themerms.lua
doc/fixes3-7-0.txt
src/sp_lev.c

index 11e42d72f0ca8e5d05b8ba249fe521b06b55b737..2f62ef9bde4e0ce196681a28172c97ddb4ac28e6 100644 (file)
@@ -197,7 +197,6 @@ themerooms = {
    end,
 
    -- Room in a room
-   -- FIXME: subroom location is too often left/top?
    function()
       des.room({ type = "ordinary", filled = 1,
                  contents = function()
index e6c1535ba2387893c0bbef1cdab3eaf67408c64e..cd32946cd631c97289600ddb0e0dd6044a5a6a19 100644 (file)
@@ -1092,6 +1092,8 @@ polymorphing into fire elemental allows you eat flammable items
 hitting sleeping monsters will cause them to wake up noisily
 demon gating happens more in Gehennom and less outside it
 intelligent peacefuls avoid digging shop or temple walls
+fix bug making random subrooms never touching the right or bottom
+       wall of the parent room
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index bf7ca8c05f4550eceb872ff166b312f0c2486d92..25dfffa187d739ae74b00a396a248b7ee7bbf5cf 100644 (file)
@@ -1648,9 +1648,9 @@ create_subroom(
     if (h == -1)
         h = rnd(height - 3);
     if (x == -1)
-        x = rnd(width - w - 1) - 1;
+        x = rnd(width - w);
     if (y == -1)
-        y = rnd(height - h - 1) - 1;
+        y = rnd(height - h);
     if (x == 1)
         x = 0;
     if (y == 1)