fixed room gen bug (disconnected rooms)

This commit is contained in:
Llywelwyn 2023-07-10 06:55:52 +01:00
parent c6639b7616
commit 8462eab0bd
2 changed files with 4 additions and 4 deletions

View file

@ -148,10 +148,10 @@ impl Map {
let (prev_x, prev_y) = map.rooms[map.rooms.len() - 1].centre();
if rng.range(0, 2) == 1 {
map.apply_horizontal_tunnel(prev_x, new_x, prev_y);
map.apply_vertical_tunnel(prev_y, new_y, prev_x);
map.apply_vertical_tunnel(prev_y, new_y, new_x);
} else {
map.apply_vertical_tunnel(prev_y, new_y, prev_x);
map.apply_horizontal_tunnel(prev_x, new_x, prev_y);
map.apply_horizontal_tunnel(prev_x, new_x, new_y);
}
}

View file

@ -137,8 +137,8 @@ fn room_table(map_depth: i32) -> RandomTable {
.add("fireball scroll", 1 + map_depth)
.add("confusion scroll", 1)
.add("magic missile scroll", 4)
.add("magic map scroll", 400)
.add("cursed magic map scroll", 400);
.add("magic map scroll", 1)
.add("cursed magic map scroll", 1);
}
fn health_potion(ecs: &mut World, x: i32, y: i32) {