This commit is contained in:
Théophyl Hoguet committed 2021-12-07 19:56:32 +01:00
1 parent 2cb36cbcb8
commit 0b2f8b5352
2 files changed
+6 -4

No files matched your search

+4 -2
View File
@@ -197,7 +197,8 @@ void game_update_flags(game g) {
game_set_square(g, i2, j,
(game_get_state(g, i2, j) | F_LIGHTED));
}
for (int i2 = i - 1; i2 > 0 && !game_is_black(g, i2, j); i2--) {
for (int i2 = i - 1; i2 >= 0 && !game_is_black(g, i2, j);
i2--) {
if (game_get_state(g, i2, j) == S_LIGHTBULB)
// update initial lightbulb on F_ERROR
game_set_square(g, i, j,
@@ -205,7 +206,8 @@ void game_update_flags(game g) {
game_set_square(g, i2, j,
(game_get_state(g, i2, j) | F_LIGHTED));
}
for (int j2 = j - 1; j2 > 0 && !game_is_black(g, i, j2); j2--) {
for (int j2 = j - 1; j2 >= 0 && !game_is_black(g, i, j2);
j2--) {
if (game_get_state(g, i, j2) == S_LIGHTBULB)
// update initial lightbulb on F_ERROR
game_set_square(g, i, j,
+2 -2
View File
@@ -278,7 +278,7 @@ bool check_update(game g) {
}
// loop checking every case before i
wall = false;
for (int k = i - 1; k > 0; k--) {
for (int k = i - 1; k >= 0; k--) {
if (/*test if current case is a wall*/ game_is_black(g, k,
j)) {
wall = true;
@@ -308,7 +308,7 @@ bool check_update(game g) {
}
}
wall = false;
for (int k = j - 1; k > 0; k--) {
for (int k = j - 1; k >= 0; k--) {
if (/*test if current case is a wall*/ game_is_black(g, i,
k)) {
wall = true;