Some fixes, draw lines on board, add 7 variants
[vchess.git] / client / src / variants / Chakart.js
index e8b95cb..a1caed4 100644 (file)
@@ -94,7 +94,7 @@ export class ChakartRules extends ChessRules {
     // A click to promote a piece on subTurn 2 would trigger this.
     // For now it would then return [NaN, NaN] because surrounding squares
     // have no IDs in the promotion modal. TODO: improve this?
-    if (!square[0]) return null;
+    if (isNaN(square[0])) return null;
     // If subTurn == 2:
     // if square is empty && firstMove is compatible,
     // complete the move (banana or bomb).