summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/gnuchess.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/chessbox/gnuchess.c')
-rw-r--r--apps/plugins/chessbox/gnuchess.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/chessbox/gnuchess.c b/apps/plugins/chessbox/gnuchess.c
index ff9bb99b91..f0600e3d67 100644
--- a/apps/plugins/chessbox/gnuchess.c
+++ b/apps/plugins/chessbox/gnuchess.c
@@ -1167,12 +1167,12 @@ void OpeningBook()
1167 m = 0; 1167 m = 0;
1168 while ( o_c < MAX_OPENING ) { 1168 while ( o_c < MAX_OPENING ) {
1169 m_c = 0 ; 1169 m_c = 0 ;
1170 for (j = 0; j <= GameCnt; j++) { 1170 for (j = 0; j < ((GameCnt + 1) & 0xFF); j++) {
1171 if ( GameList[j].gmove != OBook[o_c][m_c] ) break; 1171 if ( GameList[j].gmove != OBook[o_c][m_c] ) break;
1172 m_c++; 1172 m_c++;
1173 } 1173 }
1174 /* I added ( m != OBook[o_c][m_c] ) trying to get more random games */ 1174 /* I added ( m != OBook[o_c][m_c] ) trying to get more random games */
1175 if ( ( j > GameCnt ) && ( m != OBook[o_c][m_c] ) ) { 1175 if ( ( j >= ((GameCnt + 1) & 0xFF) ) && ( m != OBook[o_c][m_c] ) ) {
1176 r=rb->rand(); 1176 r=rb->rand();
1177 if ( r > r0 ) { 1177 if ( r > r0 ) {
1178 r0 = r; m = OBook[o_c][m_c]; 1178 r0 = r; m = OBook[o_c][m_c];
@@ -2066,7 +2066,7 @@ register short i,c,f,t;
2066short b[64]; 2066short b[64];
2067unsigned short m; 2067unsigned short m;
2068 *cnt = c = 0; 2068 *cnt = c = 0;
2069 if (GameCnt > Game50+3) 2069 if (((GameCnt + 1) & 0xFF) > Game50+4)
2070 { 2070 {
2071 for (i = 0; i < 64; b[i++] = 0); 2071 for (i = 0; i < 64; b[i++] = 0);
2072 for (i = GameCnt; i > Game50; i--) 2072 for (i = GameCnt; i > Game50; i--)