Skip to content

Commit 5d5a0f2

Browse files
committed
fixed certain 1x1 and room neighbours incorrectly loading
1 parent 876eb92 commit 5d5a0f2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/dungeon/dungeon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ impl Dungeon {
8585
for segment in segments {
8686
let x = segment.x as isize;
8787
let z = segment.z as isize;
88-
let center_x = segment.x as i32 * 32 + 15;
89-
let center_z = segment.z as i32 * 32 + 15;
88+
let center_x = segment.x as i32 * 32 + 15 + DUNGEON_ORIGIN.0;
89+
let center_z = segment.z as i32 * 32 + 15 + DUNGEON_ORIGIN.1;
9090

9191
let neighbour_options = [
9292
(x, z - 1, center_x, center_z - 16),

src/dungeon/room/room.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ impl Room {
109109
}
110110

111111
pub fn get_1x1_shape_and_type(segments: &Vec<RoomSegment>, dungeon_doors: &Vec<Door>) -> (RoomShape, Direction) {
112-
let center_x = segments[0].x as i32 * 32 + 15;
113-
let center_z = segments[0].z as i32 * 32 + 15;
112+
let center_x = segments[0].x as i32 * 32 + 15 + DUNGEON_ORIGIN.0;
113+
let center_z = segments[0].z as i32 * 32 + 15 + DUNGEON_ORIGIN.1;
114114

115115
// Actual doors found in the world
116116
let doors_opt = [
@@ -294,8 +294,6 @@ impl Room {
294294
self.load_default(world);
295295
return;
296296
}
297-
// self.load_default(world);
298-
// return;
299297

300298
let corner = self.get_corner_pos();
301299

0 commit comments

Comments
 (0)