Allow themed room subrooms to be filled
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.
This commit is contained in:
committed by
Pasi Kallinen
parent
3e0c0f6f0f
commit
0b2b0965a8
@@ -2467,7 +2467,7 @@ E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
|
||||
XCHAR_P, XCHAR_P, XCHAR_P));
|
||||
E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P));
|
||||
E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P));
|
||||
E void FDECL(fill_room, (struct mkroom *, BOOLEAN_P));
|
||||
E void FDECL(fill_special_room, (struct mkroom *, BOOLEAN_P));
|
||||
E boolean FDECL(load_special, (const char *));
|
||||
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
|
||||
E struct selectionvar *NDECL(selection_new);
|
||||
|
||||
Reference in New Issue
Block a user