Game completion detection was occasionally failing to spot a

lingering GRID_UNKNOWN, causing it to declare victory too soon.

[originally from svn r4954]
This commit is contained in:
Simon Tatham
2004-12-08 08:08:00 +00:00
parent 03e455c2c6
commit 47e9419452

View File

@ -322,16 +322,16 @@ int compute_rowdata(int *ret, unsigned char *start, int len, int step)
n = 0; n = 0;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (start[i*step] == GRID_UNKNOWN)
return -1;
if (start[i*step] == GRID_FULL) { if (start[i*step] == GRID_FULL) {
int runlen = 1; int runlen = 1;
while (i+runlen < len && start[(i+runlen)*step]) while (i+runlen < len && start[(i+runlen)*step] == GRID_FULL)
runlen++; runlen++;
ret[n++] = runlen; ret[n++] = runlen;
i += runlen; i += runlen;
} }
if (start[i*step] == GRID_UNKNOWN)
return -1;
} }
return n; return n;