From cd0674fdff3c5cdba22b3f2eabb94d55e624fed0 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Wed, 31 Jan 2024 12:54:53 +0000 Subject: [PATCH] Fix incorrect cell state setting --- src/falling_sand/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/falling_sand/mod.rs b/src/falling_sand/mod.rs index 188012e..4d958e9 100644 --- a/src/falling_sand/mod.rs +++ b/src/falling_sand/mod.rs @@ -216,16 +216,16 @@ pub fn simulate_chunk_system(mut chunk: Query<&mut Chunk>) { // Same ordering as above. if start_state != end_state { if (start_state & 0xFF000000) != (end_state & 0xFF000000) { - chunk.set_cell(x, y + 1, Element::from((start_state >> 24) & 0xFF)); + chunk.set_cell(x, y + 1, Element::from((end_state >> 24) & 0xFF)); } if (start_state & 0x00FF0000) != (end_state & 0x00FF0000) { - chunk.set_cell(x + 1, y + 1, Element::from((start_state >> 16) & 0xFF)); + chunk.set_cell(x + 1, y + 1, Element::from((end_state >> 16) & 0xFF)); } if (start_state & 0x0000FF00) != (end_state & 0x0000FF00) { - chunk.set_cell(x, y, Element::from((start_state >> 8) & 0xFF)); + chunk.set_cell(x, y, Element::from((end_state >> 8) & 0xFF)); } if (start_state & 0x000000FF) != (end_state & 0x000000FF) { - chunk.set_cell(x + 1, y, Element::from(start_state & 0xFF)); + chunk.set_cell(x + 1, y, Element::from(end_state & 0xFF)); } } }