Fix rare door in corner of room bug
There were couple reports of doors being generated in a corner of a room. This happened for randomly generated irregular rooms, because the code that was deciding if a corridor starting or ending location was good did not handle irregular rooms at all. This changes the corridor code so it can now generate start and end points properly for any valid position in irregular rooms, instead of only on the edges. This means the corridor sometimes meanders a bit more than before, because it tries to find the end point away from the edge of the room rectangle. Also added is sanity checking for the randomly generated rooms and corridors level, testing for door placement and room connectivity. And another fix for a rare special case where dig_corridor created a zero-tile long corridor; the entrance door was placed, but there was nothing behind it. Fixes github #1269 and #1385
This commit is contained in:
@@ -2972,7 +2972,7 @@ extern void flip_level_rnd(int, boolean);
|
||||
extern boolean check_room(coordxy *, coordxy *, coordxy *, coordxy *, boolean) NONNULLPTRS;
|
||||
extern boolean create_room(coordxy, coordxy, coordxy, coordxy,
|
||||
coordxy, coordxy, xint16, xint16);
|
||||
extern boolean dig_corridor(coord *, coord *, boolean, schar, schar) NONNULLARG12;
|
||||
extern boolean dig_corridor(coord *, coord *, int *, boolean, schar, schar) NONNULLARG12;
|
||||
extern void fill_special_room(struct mkroom *) NO_NNARGS;
|
||||
extern void wallify_map(coordxy, coordxy, coordxy, coordxy);
|
||||
extern boolean load_special(const char *) NONNULLARG1;
|
||||
|
||||
Reference in New Issue
Block a user