From 6e2ab5837bfadab542a9c3547906e86a6dc3b4e5 Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Mon, 3 Apr 2023 11:01:12 +0200 Subject: [PATCH] Make chunk coordinate type 32 bits This ensures there isn't a problem converting between world coords and chunk coords. Since the world center if half of max of u32, this is a very real problem to handle with only 16 bits. --- src/world.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world.rs b/src/world.rs index 015d7fa..7387f55 100644 --- a/src/world.rs +++ b/src/world.rs @@ -1,7 +1,7 @@ use fnv::FnvHashMap; use rand::{thread_rng, Rng}; -type ChunkPosScalar = u16; +type ChunkPosScalar = u32; #[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)] pub struct ChunkPos {