From 889c193a05226978c41f5a71103e037a9e9d0ea4 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 29 Jan 2023 23:11:36 +0100 Subject: [PATCH] fix bug in neighbor code --- src/world/neighbors.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/world/neighbors.rs b/src/world/neighbors.rs index 5151bce..75d2a29 100644 --- a/src/world/neighbors.rs +++ b/src/world/neighbors.rs @@ -88,8 +88,8 @@ impl super::ChunkStorage { pub fn neighbors(&self, coords: IVec3) -> ChunkNeighbors { ChunkNeighbors { center: self.chunks.get(&coords), - top: self.chunks.get(&(coords - ivec3(0, 1, 0))), - bottom: self.chunks.get(&(coords + ivec3(0, 1, 0))), + top: self.chunks.get(&(coords + ivec3(0, 1, 0))), + bottom: self.chunks.get(&(coords - ivec3(0, 1, 0))), left: self.chunks.get(&(coords - ivec3(1, 0, 0))), right: self.chunks.get(&(coords + ivec3(1, 0, 0))), front: self.chunks.get(&(coords + ivec3(0, 0, 1))), @@ -110,8 +110,8 @@ impl super::ChunkStorage { back ] = self.chunks.get_many_mut([ &coords, - &(coords - ivec3(0, 1, 0)), &(coords + ivec3(0, 1, 0)), + &(coords - ivec3(0, 1, 0)), &(coords - ivec3(1, 0, 0)), &(coords + ivec3(1, 0, 0)), &(coords + ivec3(0, 0, 1)),