Add Koopa chess, fix Apocalypse and Dice variants
[vchess.git] / client / src / components / Board.vue
index 0fd4e1f..5ed351a 100644 (file)
@@ -64,6 +64,9 @@ export default {
           lmHighlights[m.start.x + sizeX * m.start.y] = true;
         if (!m.end.noHighlight && V.OnBoard(m.end.x, m.end.y))
           lmHighlights[m.end.x + sizeX * m.end.y] = true;
+        if (!!m.start.toplay)
+          // For Dice variant (at least?)
+          lmHighlights[m.start.toplay[0] + sizeX * m.start.toplay[1]] = true;
       });
     }
     const showLight = (
@@ -638,6 +641,7 @@ export default {
           const color = this.analyze ? this.vr.turn : this.userColor;
           if (this.vr.canIplay(color, startSquare))
             this.possibleMoves = this.vr.getPossibleMovesFrom(startSquare);
+          else return;
           // For potential drag'n drop, remember start coordinates
           // (to center the piece on mouse cursor)
           const rect = parent.getBoundingClientRect();