Results of today's code review session.

This commit is contained in:
Zed A. Shaw 2025-01-05 15:07:30 -05:00
parent 14b3ea7676
commit f35b74f335
21 changed files with 64 additions and 59 deletions

View file

@ -49,7 +49,13 @@ Point Map::place_entity(size_t room_index) {
Room &start = $rooms[room_index];
return {start.x+start.width/2, start.y+start.height/2};
size_t size = std::max(start.width, start.height);
for(matrix::box it{$walls, start.x, start.y, size}; it.next();) {
if(!iswall(it.x, it.y)) return {it.x, it.y};
}
dbc::sentinel("DIDN'T FIND AN OPEN SPACE!");
return {start.x, start.y};
}
bool Map::iswall(size_t x, size_t y) {