git fix underflow bug

This commit is contained in:
Joachim Lusiardi 2023-11-21 21:27:26 +01:00
parent f9deea4bde
commit 470d00bbe1
1 changed files with 6 additions and 6 deletions

View File

@ -80,15 +80,15 @@ impl Level {
break; break;
} }
} }
for x_r in (max(x - 2, 0)..x).rev() { for x_r in (max(x, 2)..x + 2).rev() {
self.discovered[x_r][y] = true; self.discovered[x_r - 2][y] = true;
if self.structure[x_r][y] == LevelElement::Wall { if self.structure[x_r - 2][y] == LevelElement::Wall {
break; break;
} }
} }
for y_r in (max(y - 2, 0)..y).rev() { for y_r in (max(y, 2)..y + 2).rev() {
self.discovered[x][y_r] = true; self.discovered[x][y_r - 2] = true;
if self.structure[x][y_r] == LevelElement::Wall { if self.structure[x][y_r - 2] == LevelElement::Wall {
break; break;
} }
} }