diff --git a/CHANGELOG.md b/CHANGELOG.md index 532b0a2e51..b0d87d7d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 one of them active at the same time - Made zooming work on wayland - Fixed AI behavior so only humanoids will attempt to roll +- Fixed a bug where the stairs to the boss floor in dungeons would sometimes not spawn ## [0.8.0] - 2020-11-28 diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 061b68ce8c..9b9b5a3518 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -267,9 +267,10 @@ impl Floor { level: i32, difficulty: u32, ) -> (Self, Vec2) { + const MAX_WIDTH: u32 = 4; let floors = 3 + difficulty / 2; let final_level = level == floors as i32 - 1; - let width = (2 + difficulty / 2).min(4); + let width = (2 + difficulty / 2).min(MAX_WIDTH); let height = (15 + difficulty * 3).min(30); let new_stair_tile = if final_level { @@ -309,8 +310,6 @@ impl Floor { pillars: None, difficulty, }); - this.tiles - .set(stair_tile - tile_offset, Tile::UpStair(upstair_room)); if final_level { // Boss room this.create_room(Room { @@ -320,7 +319,7 @@ impl Floor { miniboss: false, boss: true, area: Rect::from(( - new_stair_tile - tile_offset - 4, + new_stair_tile - tile_offset - MAX_WIDTH as i32 - 1, Extent2::broadcast(width as i32 * 2 + 1), )), height: height as i32, @@ -345,6 +344,8 @@ impl Floor { Tile::DownStair(downstair_room), ); } + this.tiles + .set(stair_tile - tile_offset, Tile::UpStair(upstair_room)); this.create_rooms(ctx, level, 7); // Create routes between all rooms