Fixed a bunch of random little bugs everywhere.
This commit is contained in:
parent
f946d46936
commit
6b3ce5eb3d
9 changed files with 64 additions and 38 deletions
|
@ -6,8 +6,7 @@ using namespace fmt;
|
|||
|
||||
inline int make_split(Room &cur, bool horiz) {
|
||||
size_t dimension = horiz ? cur.height : cur.width;
|
||||
// BUG: this might be better as a configurable 4 number
|
||||
int min = dimension / 4;
|
||||
int min = dimension / WORLDBUILD_DIVISION;
|
||||
int max = dimension - min;
|
||||
|
||||
return Random::uniform<int>(min, max);
|
||||
|
@ -156,13 +155,11 @@ void WorldBuilder::make_room(size_t origin_x, size_t origin_y, size_t w, size_t
|
|||
|
||||
void WorldBuilder::place_rooms() {
|
||||
for(auto &cur : $map.$rooms) {
|
||||
cur.x += 2;
|
||||
cur.y += 2;
|
||||
cur.width -= 4;
|
||||
cur.height -= 4;
|
||||
cur.x += WORLDBUILD_SHRINK;
|
||||
cur.y += WORLDBUILD_SHRINK;
|
||||
cur.width -= WORLDBUILD_SHRINK * 2;
|
||||
cur.height -= WORLDBUILD_SHRINK * 2;
|
||||
|
||||
// BUG: should I do this each time I connect rooms
|
||||
// BUG: rather than once when the room is created?
|
||||
add_door(cur);
|
||||
make_room(cur.x, cur.y, cur.width, cur.height);
|
||||
}
|
||||
|
@ -187,7 +184,7 @@ bool WorldBuilder::dig_tunnel(PointList &holes, Point &src, Point &target) {
|
|||
if(paths[out.y][out.x] == 0) {
|
||||
return true;
|
||||
}
|
||||
} while(found && ++count < 200);
|
||||
} while(found && ++count < WORLDBUILD_MAX_PATH);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue