X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FApocalypse.js;h=e817296ac219bc0f12b5c7cdd20c66e74e379e07;hb=8d8a70d9c1b699075e0d4313cabe5cc0269a7840;hp=2439ae5dcdf35b28d908a35b82c8e21963d66798;hpb=6e0f28425075e6d2d79cab6d30bca6ce6d55f19d;p=vchess.git diff --git a/client/src/variants/Apocalypse.js b/client/src/variants/Apocalypse.js index 2439ae5d..e817296a 100644 --- a/client/src/variants/Apocalypse.js +++ b/client/src/variants/Apocalypse.js @@ -2,6 +2,7 @@ import { ChessRules } from "@/base_rules"; import { randInt } from "@/utils/alea"; export class ApocalypseRules extends ChessRules { + static get PawnSpecs() { return Object.assign( {}, @@ -55,7 +56,7 @@ export class ApocalypseRules extends ChessRules { if (['P','p'].includes(row[i])) pawns[row[i]]++; if (V.PIECES.includes(row[i].toLowerCase())) sumElts++; else { - const num = parseInt(row[i]); + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -139,8 +140,8 @@ export class ApocalypseRules extends ChessRules { setFlags(fenflags) { this.penaltyFlags = { - 'w': parseInt(fenflags[0]), - 'b': parseInt(fenflags[1]) + 'w': parseInt(fenflags[0], 10), + 'b': parseInt(fenflags[1], 10) }; } @@ -512,4 +513,5 @@ export class ApocalypseRules extends ChessRules { V.CoordsToSquare(move.end) ); } + };