From 107f3cdae7b68208fa56e79baa379359adcf5ec6 Mon Sep 17 00:00:00 2001 From: illegitimate-egg Date: Mon, 24 Feb 2025 23:54:01 +0000 Subject: [PATCH] Fix the world array position miscalculation causing crashes --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0e08be6..12e6e81 100644 --- a/src/main.rs +++ b/src/main.rs @@ -212,7 +212,7 @@ fn handle_client(mut stream: TcpStream, client_number: u8, players_arc_clone: Ar block_type = 0x00; // Air } - let world_offset = position_x + (position_z * SIZE_X) + (position_y * SIZE_X * SIZE_Z); + let world_offset: u32 = position_x as u32 + (position_z as u32 * SIZE_X as u32) + (position_y as u32 * SIZE_X as u32 * SIZE_Z as u32); { let mut world_dat = world_arc_clone.lock().unwrap();