Merge branch 'master' of auder.net:vchess
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 3 Mar 2020 22:13:19 +0000 (23:13 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 3 Mar 2020 22:13:19 +0000 (23:13 +0100)
1  2 
client/src/views/Game.vue
client/src/views/Hall.vue

@@@ -703,11 -661,14 +699,15 @@@ export default 
          // Update current game object (no need for moves stack):
          playMove(move, this.vr);
          this.game.movesCount++;
 +        // TODO: notifyTurn
          // (add)Time indication: useful in case of lastate infos requested
-         this.game.moves.push({move:move, addTime:addTime});
+         this.game.moves.push(this.game.type == "live"
+           ? {move:move, addTime:addTime}
+           : move);
          this.game.fen = this.vr.getFen();
-         this.game.clocks[colorIdx] += addTime;
+         if (this.game.type == "live") this.game.clocks[colorIdx] += addTime;
+         // In corr games, just reset clock to mainTime:
+         else this.game.clocks[colorIdx] = extractTime(this.game.cadence).mainTime;
          // data.initime is set only when I receive a "lastate" move from opponent
          this.game.initime[nextIdx] = (data && data.initime) ? data.initime : Date.now();
          this.re_setClocks();
Simple merge