short rtf = in_opening_stage ? 8 : 2;
short tcq = in_opening_stage ? 2 : 4;
- TimeControl.clock[side] += TCadd;
+ if(!xboard) /* no pre-add of increment in XBoard mode */
+ TimeControl.clock[side] += TCadd;
ResponseTime = (TimeControl.clock[side])
/ (((TimeControl.moves[side]) * rtf) + 1);
TCleft = (long)ResponseTime / tcq;
else
{
/* calculate avg time per move remaining */
- TimeControl.clock[side] += TCadd;
+
+ if(!xboard) /* no pre-add of increment in XBoard mode */
+ TimeControl.clock[side] += TCadd;
ResponseTime = (TimeControl.clock[side])
/ (((TimeControl.moves[side]) * 2) + 1);
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();
+ }
+}