From fbdf77614144d46b8959a464359f39d812f81e92 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 25 Feb 2024 23:25:35 +0100 Subject: [PATCH] always check if tile-group is ative separately from counting group members --- src/azul.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/azul.rs b/src/azul.rs index 1a8b63e..de3e6a7 100644 --- a/src/azul.rs +++ b/src/azul.rs @@ -697,13 +697,14 @@ impl Player { let mut count = 0; let mut active = false; for i in 0..5 { + if (row, i) == (row, column) { + active = true; + } + if active == true && wall[row][i] == false { break; } else if wall[row][i] == false { count = 0; - } else if (row, i) == (row, column) { - active = true; - count += 1; } else { count += 1 } @@ -714,13 +715,14 @@ impl Player { let mut count = 0; let mut active = false; for i in 0..5 { + if (i, column) == (row, column) { + active = true; + } + if active == true && wall[i][column] == false { break; } else if wall[i][column] == false { count = 0; - } else if (i, column) == (row, column) { - active = true; - count += 1; } else { count += 1 }