From 8d18843147def570178abb0bab60d52e40c96a67 Mon Sep 17 00:00:00 2001 From: IQuant Date: Sun, 12 Oct 2025 16:36:59 +0300 Subject: [PATCH] Fix world encode --- ewext/src/modules/world_sync.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ewext/src/modules/world_sync.rs b/ewext/src/modules/world_sync.rs index c0b9bb1d..3d8953ca 100644 --- a/ewext/src/modules/world_sync.rs +++ b/ewext/src/modules/world_sync.rs @@ -99,16 +99,18 @@ impl WorldData for ParticleWorldState { else { return Err(eyre!("chunk not loaded")); }; + let mut chunk_iter = chunk.iter_mut(); let (shift_x, shift_y) = self.get_shift::(cx, cy); - for ((j, i), p) in (shift_x..shift_x + CHUNK_SIZE as isize) - .flat_map(|i| (shift_y..shift_y + CHUNK_SIZE as isize).map(move |j| (i, j))) - .zip(chunk.iter_mut()) - { - *p = pixel_array.get_pixel(i, j); + for j in shift_y..shift_y + CHUNK_SIZE as isize { + for i in shift_x..shift_x + CHUNK_SIZE as isize { + *chunk_iter.next().unwrap() = pixel_array.get_pixel(i, j); + } } + Ok(()) } unsafe fn decode_world(&self, chunk: NoitaWorldUpdate) -> eyre::Result<()> { + return Ok(()); // TODO let chunk_coord = chunk.coord; let (cx, cy) = (chunk_coord.0 as isize, chunk_coord.1 as isize); let Some(pixel_array) = unsafe { self.world_ptr.as_mut() }