When the gamelist was filtered, the game that was highlingted was the
n-th game in the list rather than the n-th game in the file, when the
latter was loaded (and n did not exceed the number of filtered games).
This is fixed now by searching for the line in the listbox that starts
with the game number n, rather than taking the n-th line.
\r
VOID GameListHighlight(int index)\r
{\r
+ char buf[MSG_SIZ];\r
+ int i, res = 0;\r
if (gameListDialog == NULL) return;\r
+ for(i=0; res != LB_ERR; i++) {\r
+ res = SendDlgItemMessage( gameListDialog, OPT_GameListText, LB_GETTEXT, i, (LPARAM)buf );\r
+ if(index <= atoi( buf )) break;\r
+ }\r
SendDlgItemMessage(gameListDialog, OPT_GameListText,\r
- LB_SETCURSEL, index - 1, 0);\r
+ LB_SETCURSEL, i, 0);\r
}\r
\r
\r