ChessSquare pieceSweep = EmptySquare;
ChessSquare promoSweep = EmptySquare, defaultPromoChoice;
int promoDefaultAltered;
+int keepInfo = 0; /* [HGM] to protect PGN tags in auto-step game analysis */
/* States for ics_getting_history */
#define H_FALSE 0
}
}
+void
+AnalyzeNextGame()
+{
+ ReloadGame(1); // next game
+}
int
AutoPlayOneMove ()
}
if (currentMove >= forwardMostMove) {
- if(gameMode == AnalyzeFile) { ExitAnalyzeMode(); SendToProgram("force\n", &first); }
+ if(gameMode == AnalyzeFile) {
+ if(appData.loadGameIndex == -1) {
+ GameEnds(EndOfFile, NULL, GE_FILE);
+ ScheduleDelayedEvent(AnalyzeNextGame, 10);
+ } else {
+ ExitAnalyzeMode(); SendToProgram("force\n", &first);
+ }
+ }
// gameMode = EndOfGame;
// ModeHighlight();
gn = 1;
}
else {
+ if(gameMode == AnalyzeFile && appData.loadGameIndex == -1)
+ appData.loadGameIndex = 0; // [HGM] suppress error message if we reach file end after auto-stepping analysis
+ else
DisplayError(_("Game number out of range"), 0);
return FALSE;
}
if (oldGameMode == AnalyzeFile ||
oldGameMode == AnalyzeMode) {
+ appData.loadGameIndex = -1; // [HGM] order auto-stepping through games
+ keepInfo = 1;
AnalyzeFileEvent();
+ keepInfo = 0;
}
if (!matchMode && pos > 0) {
ChessMove r = GameUnfinished;
char *p = NULL;
+ if(keepInfo) return;
+
if(gameMode == EditGame) { // [HGM] vari: do not erase result on EditGame
r = gameInfo.result;
p = gameInfo.resultDetails;