Fix incheck bug
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 5 Feb 2020 13:18:11 +0000 (14:18 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 5 Feb 2020 13:18:11 +0000 (14:18 +0100)
client/src/components/BaseGame.vue
client/src/components/Board.vue

index 1240bcb..ea07a6d 100644 (file)
@@ -17,7 +17,7 @@ div#baseGame(tabindex=-1 @click="() => focusBg()"
     #boardContainer
       Board(:vr="vr" :last-move="lastMove" :analyze="analyze"
         :user-color="game.mycolor" :orientation="orientation"
-        :vname="game.vname" @play-move="play")
+        :vname="game.vname" :incheck="incheck" @play-move="play")
       #turnIndicator(v-if="game.vname=='Dark' && game.score=='*'")
         | {{ turn }}
       #controls
@@ -71,6 +71,7 @@ export default {
       cursor: -1, //index of the move just played
       lastMove: null,
       firstMoveNumber: 0, //for printing
+      incheck: [], //for Board
     };
   },
   watch: {
index 6a20d54..4123def 100644 (file)
@@ -8,13 +8,12 @@ export default {
   // Last move cannot be guessed from here, and is required to highlight squares
   // vr: object to check moves, print board...
   // userColor is left undefined for an external observer
-  props: ["vr","lastMove","analyze","orientation","userColor","vname"],
+  props: ["vr","lastMove","analyze","incheck","orientation","userColor","vname"],
   data: function () {
     return {
       possibleMoves: [], //filled after each valid click/dragstart
       choices: [], //promotion pieces, or checkered captures... (as moves)
       selectedPiece: null, //moving piece (or clicked piece)
-      incheck: [],
       start: {}, //pixels coordinates + id of starting square (click or drag)
       settings: store.state.settings,
     };