Turned on all the warnings I could handle and made them into errors then fixed them all. Worldbuilder needs a refactor in random_path.
This commit is contained in:
parent
f3f875ee80
commit
128fc4f540
19 changed files with 85 additions and 85 deletions
|
@ -82,13 +82,11 @@ void WorldBuilder::partition_map(Room &cur, int depth) {
|
|||
|
||||
// BUG: min room size should be configurable
|
||||
if(depth > 0 && left.width > 2 && left.height > 2) {
|
||||
left.depth = depth - 1;
|
||||
partition_map(left, depth-1);
|
||||
}
|
||||
|
||||
// BUG: min room size should be configurable
|
||||
if(depth > 0 && right.width > 2 && right.height > 2) {
|
||||
right.depth = depth - 1;
|
||||
partition_map(right, depth-1);
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +271,7 @@ void WorldBuilder::place_rooms() {
|
|||
}
|
||||
}
|
||||
|
||||
inline bool random_path(Map &map, PointList &holes, Point src, Point target) {
|
||||
inline bool random_path(Map &map, PointList &holes, Point src) {
|
||||
bool found = false;
|
||||
Matrix &paths = map.paths();
|
||||
Point out{src.x, src.y};
|
||||
|
@ -306,7 +304,7 @@ bool WorldBuilder::dig_tunnel(PointList &holes, Point &src, Point &target) {
|
|||
dbc::check(paths[target.y][target.x] != WALL_PATH_LIMIT,
|
||||
"target room has path as a wall");
|
||||
|
||||
if(!random_path($map, holes, src, target)) {
|
||||
if(!random_path($map, holes, src)) {
|
||||
straight_path(holes, src, target);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue