mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Fix missing error highlights (+ array underrun!) in Pearl.
I was accidentally re-checking the value of component_state[comp] after resetting comp to the special value -1, which caused a failure to highlight stray path-shaped components if they existed in addition to a large loop component. (Plus, of course, it's just illegal no matter what visible behaviour it does or doesn't cause in practice.) Fixed by adjusting the code to more closely match the version in Loopy (I wonder how I managed to add two pieces of code in commit b31155b73 without noticing this difference between them).
This commit is contained in:
2
pearl.c
2
pearl.c
@ -1610,8 +1610,6 @@ static void check_completion(game_state *state, int mark)
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < w*h; i++) {
|
for (i = 0; i < w*h; i++) {
|
||||||
int comp = dsf_canonify(dsf, i);
|
int comp = dsf_canonify(dsf, i);
|
||||||
if (component_state[comp] == COMP_PATH)
|
|
||||||
comp = -1; /* part of the 'all paths' quasi-component */
|
|
||||||
if ((component_state[comp] == COMP_PATH &&
|
if ((component_state[comp] == COMP_PATH &&
|
||||||
-1 != largest_comp) ||
|
-1 != largest_comp) ||
|
||||||
(component_state[comp] == COMP_LOOP &&
|
(component_state[comp] == COMP_LOOP &&
|
||||||
|
Reference in New Issue
Block a user