fix bug
This commit is contained in:
1 parent
2cb36cbcb8
commit
0b2f8b5352
2 files changed
+6
-4
No files matched your search
@@ -197,7 +197,8 @@ void game_update_flags(game g) {
|
|||||||
game_set_square(g, i2, j,
|
game_set_square(g, i2, j,
|
||||||
(game_get_state(g, i2, j) | F_LIGHTED));
|
(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)
|
if (game_get_state(g, i2, j) == S_LIGHTBULB)
|
||||||
// update initial lightbulb on F_ERROR
|
// update initial lightbulb on F_ERROR
|
||||||
game_set_square(g, i, j,
|
game_set_square(g, i, j,
|
||||||
@@ -205,7 +206,8 @@ void game_update_flags(game g) {
|
|||||||
game_set_square(g, i2, j,
|
game_set_square(g, i2, j,
|
||||||
(game_get_state(g, i2, j) | F_LIGHTED));
|
(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)
|
if (game_get_state(g, i, j2) == S_LIGHTBULB)
|
||||||
// update initial lightbulb on F_ERROR
|
// update initial lightbulb on F_ERROR
|
||||||
game_set_square(g, i, j,
|
game_set_square(g, i, j,
|
||||||
|
|||||||
+2
-2
@@ -278,7 +278,7 @@ bool check_update(game g) {
|
|||||||
}
|
}
|
||||||
// loop checking every case before i
|
// loop checking every case before i
|
||||||
wall = false;
|
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,
|
if (/*test if current case is a wall*/ game_is_black(g, k,
|
||||||
j)) {
|
j)) {
|
||||||
wall = true;
|
wall = true;
|
||||||
@@ -308,7 +308,7 @@ bool check_update(game g) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wall = false;
|
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,
|
if (/*test if current case is a wall*/ game_is_black(g, i,
|
||||||
k)) {
|
k)) {
|
||||||
wall = true;
|
wall = true;
|
||||||
|
|||||||
Reference in new issue
Block a user