diff options
Diffstat (limited to 'apps/plugins/chessbox/gnuchess.c')
-rw-r--r-- | apps/plugins/chessbox/gnuchess.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/plugins/chessbox/gnuchess.c b/apps/plugins/chessbox/gnuchess.c index 5e67df4f39..4b21cd785c 100644 --- a/apps/plugins/chessbox/gnuchess.c +++ b/apps/plugins/chessbox/gnuchess.c | |||
@@ -103,8 +103,9 @@ short INCscore; | |||
103 | short HasPawn[2],HasKnight[2],HasBishop[2],HasRook[2],HasQueen[2]; | 103 | short HasPawn[2],HasKnight[2],HasBishop[2],HasRook[2],HasQueen[2]; |
104 | short ChkFlag[maxdepth],CptrFlag[maxdepth],PawnThreat[maxdepth]; | 104 | short ChkFlag[maxdepth],CptrFlag[maxdepth],PawnThreat[maxdepth]; |
105 | short Pscore[maxdepth],Tscore[maxdepth],Threat[maxdepth]; | 105 | short Pscore[maxdepth],Tscore[maxdepth],Threat[maxdepth]; |
106 | struct GameRec GameList[240]; | 106 | struct GameRec GameList[MAX_GAME_CNT]; |
107 | short GameCnt,Game50,epsquare,lpost,rcptr,contempt; | 107 | unsigned char GameCnt; /*Bug fix now rolls over instead of overflow*/ |
108 | short Game50,epsquare,lpost,rcptr,contempt; | ||
108 | short MaxSearchDepth,Xscore; | 109 | short MaxSearchDepth,Xscore; |
109 | struct TimeControlRec TimeControl; | 110 | struct TimeControlRec TimeControl; |
110 | short TCflag,TCmoves,TCminutes,OperatorTime; | 111 | short TCflag,TCmoves,TCminutes,OperatorTime; |
@@ -1132,7 +1133,7 @@ static short i,alpha,beta,score,tempb,tempc,tempsf,tempst,xside,rpt; | |||
1132 | if (--TimeControl.moves[side] == 0) SetTimeControl(); | 1133 | if (--TimeControl.moves[side] == 0) SetTimeControl(); |
1133 | } | 1134 | } |
1134 | if ((root->flags & draw) && bothsides) quit = true; | 1135 | if ((root->flags & draw) && bothsides) quit = true; |
1135 | if (GameCnt > 238) quit = true; | 1136 | if (GameCnt > MAX_GAME_CNT - 2) quit = true; |
1136 | player = xside; | 1137 | player = xside; |
1137 | Sdepth = 0; | 1138 | Sdepth = 0; |
1138 | return(0); | 1139 | return(0); |
@@ -2319,7 +2320,7 @@ void NewGame() { | |||
2319 | xwndw = 90; | 2320 | xwndw = 90; |
2320 | MaxSearchDepth = 29; | 2321 | MaxSearchDepth = 29; |
2321 | contempt = 0; | 2322 | contempt = 0; |
2322 | GameCnt = -1; Game50 = 0; | 2323 | GameCnt = MAX_GAME_CNT - 1; Game50 = 0; |
2323 | Zwmtl = Zbmtl = 0; | 2324 | Zwmtl = Zbmtl = 0; |
2324 | Developed[white] = Developed[black] = false; | 2325 | Developed[white] = Developed[black] = false; |
2325 | castld[white] = castld[black] = false; | 2326 | castld[white] = castld[black] = false; |