From: Pasi Kallinen Date: Mon, 23 Jan 2023 17:41:29 +0000 (+0200) Subject: Fix ancient subroom location bug X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83eaa85dd8dfadb90809f082ea129798405df3d4;p=nethack Fix ancient subroom location bug 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 --- diff --git a/dat/themerms.lua b/dat/themerms.lua index 11e42d72f..2f62ef9bd 100644 --- a/dat/themerms.lua +++ b/dat/themerms.lua @@ -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() diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index e6c1535ba..cd32946cd 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 diff --git a/src/sp_lev.c b/src/sp_lev.c index bf7ca8c05..25dfffa18 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -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)