Remove unreachable areas. Fixed #16

This commit is contained in:
klangner 2020-10-16 08:13:43 +02:00
parent bd7b12e57d
commit 8f2c07c4ae

View File

@ -78,6 +78,8 @@ impl World {
let mut rng = StdRng::seed_from_u64(seed as u64); let mut rng = StdRng::seed_from_u64(seed as u64);
let map = MapBuilder::new(80, 50) let map = MapBuilder::new(80, 50)
.with(DrunkardsWalk::open_halls()) .with(DrunkardsWalk::open_halls())
.with(AreaStartingPosition::new(XStart::CENTER, YStart::CENTER))
.with(CullUnreachable::new())
.build_with_rng(&mut rng); .build_with_rng(&mut rng);
let tiles = (0..map.tiles.len()) let tiles = (0..map.tiles.len())
.map(|i| if map.tiles[i] == TileType::Floor {Cell::Floor} else {Cell::Wall}) .map(|i| if map.tiles[i] == TileType::Floor {Cell::Floor} else {Cell::Wall})