extern void ExitShogi(void);
extern void ClearScreen(void);
extern void SetTimeControl(void);
+extern void RenewTimeControl(int side, int TCadd);
extern void SelectLevel(char *sx);
extern void
else
InputCommand(true);
- if (opponent == white)
- {
- if (flag.gamein || TCadd)
- {
- TimeCalc();
- }
- else if (TimeControl.moves[opponent] == 0)
- {
- if (XC)
- {
- if (XCmore < XC)
- {
- TCmoves = XCmoves[XCmore];
- TCminutes = XCminutes[XCmore];
- TCseconds = XCseconds[XCmore];
- XCmore++;
- }
- }
-
- SetTimeControl();
- }
- }
+ if(opponent == white)
+ RenewTimeControl(opponent, TCadd);
compptr = (compptr + 1) % MINGAMEIN;
#endif
SelectMove(computer, FOREGROUND_MODE);
- if (computer == white)
- {
- if (flag.gamein)
- {
- TimeCalc();
- }
- else if (TimeControl.moves[computer] == 0)
- {
- if (XC)
- {
- if (XCmore < XC)
- {
- TCmoves = XCmoves[XCmore];
- TCminutes = XCminutes[XCmore];
- TCseconds = XCseconds[XCmore];
- XCmore++;
- }
- }
-
- SetTimeControl();
- }
- }
+ if(computer == white)
+ RenewTimeControl(computer, false);
}
}
et = 0;
ElapsedTime(COMPUTE_AND_INIT_MODE);
}
+
+void
+RenewTimeControl(int side, int TCadd)
+{
+ if (flag.gamein || TCadd)
+ {
+ TimeCalc();
+ }
+ else if (TimeControl.moves[side] == 0)
+ {
+ if (XC)
+ {
+ if (XCmore < XC)
+ {
+ TCmoves = XCmoves[XCmore];
+ TCminutes = XCminutes[XCmore];
+ TCseconds = XCseconds[XCmore];
+ XCmore++;
+ }
+ }
+
+ SetTimeControl();
+ }
+}