World builder does a better job of placing entities in rooms and not walls.

This commit is contained in:
Zed A. Shaw 2024-12-28 13:32:18 -05:00
parent 03c5546cdf
commit 8d661b785b
2 changed files with 7 additions and 3 deletions

View file

@ -48,8 +48,8 @@ Point Map::place_entity(size_t room_index) {
dbc::check(room_index < $rooms.size(), "room_index is out of bounds, not enough rooms");
Room &start = $rooms[room_index];
// BUG: this can place someone in a wall on accident, move them if they're stuck
return {start.x+1, start.y+1};
return {start.x+start.width/2, start.y+start.height/2};
}
bool Map::iswall(size_t x, size_t y) {