I noticed that any subrooms created within a themed room were bare - they never had any monsters, objects, traps, or anything really, regardless of whether filled = 1 was set on them. As a result, they're pretty boring. It turns out that the code in makelevel() responsible for stocking ordinary rooms with stuff only looped through g.rooms, and completely ignored subrooms. (Subrooms would not get stocked with items by virtue of being part of the larger room; I tested this by dialing the item generation in rooms way up, and none of those items ever got placed in a subroom.) To fix this, I've extracted the code that populates an ordinary room into its own function, fill_ordinary_room, and made it recurse into its own subrooms. (I also renamed fill_rooms and fill_room to include the word "special" in their names, because they only deal with special rooms.) Note that since special rooms follow a separate codepath, an ordinary subroom of a special room won't get stocked; perhaps these functions should be unified in the future. The fill_ordinary_room code is pretty much a verbatim cut and paste from makelevel, so there is not currently any consideration for the size of the subroom or the fact that it is a subroom with respect to how many monsters, traps, objects, etc get placed. I'm not sure whether other things such as stair selection will ever select themed room subrooms, or whether they too only look at g.rooms.
118 KiB
118 KiB