X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=5b335b0fab80877795a126c48306e0a6414b1214;hb=b627d118ab41dccbda68f4523de8f063d0fa89df;hp=149bb4d22a1eabc5f05aec382c264b80647d822e;hpb=a97bdbda4ecf83645d409b717e36828784d1450d;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 149bb4d2..5b335b0f 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -395,14 +395,12 @@ export const ChessRules = class ChessRules { ////////////////// // INITIALIZATION - constructor(fen) { - // In printDiagram() fen isn't supply because only getPpath() is used - if (fen) - this.re_init(fen); - } - // Fen string fully describes the game state - re_init(fen) { + constructor(fen) { + if (!fen) + // In printDiagram() fen isn't supply because only getPpath() is used + // TODO: find a better solution! + return; const fenParsed = V.ParseFen(fen); this.board = V.GetBoard(fenParsed.position); this.turn = fenParsed.turn[0]; //[0] to work with MarseilleRules