X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSchess.js;h=07556a50de5852e976d5a2edfdf322b2b9c1de95;hb=0d5335de5c94d780e03ac0aa3279b731c69455cc;hp=d2e352881dc84f92ca521a578c155ccc46d68f5b;hpb=4ec83d3789a69429297710413bf640be51d10e41;p=vchess.git diff --git a/client/src/variants/Schess.js b/client/src/variants/Schess.js index d2e35288..07556a50 100644 --- a/client/src/variants/Schess.js +++ b/client/src/variants/Schess.js @@ -33,10 +33,6 @@ export class SchessRules extends ChessRules { return b; } - // TODO: maybe changes could be done to this method to show "empty" - // instead of a piece to not use a pocket piece... -// getPPpath(b) { } - static IsGoodFen(fen) { if (!ChessRules.IsGoodFen(fen)) return false; const fenParsed = V.ParseFen(fen); @@ -54,7 +50,7 @@ export class SchessRules extends ChessRules { setFlags(fenflags) { super.setFlags(fenflags); //castleFlags this.pieceFlags = { - w: [...Array(8)], //pawns can move 2 squares? + w: [...Array(8)], //pieces can generate Hawk or Elephant? b: [...Array(8)] }; const flags = fenflags.substr(4); //skip first 4 letters, for castle @@ -193,7 +189,7 @@ export class SchessRules extends ChessRules { } shift = (m.appear[0].p == V.NOTHING ? 1 : 0); if ( - m.appear.length >= 2 && + m.appear.length >= 2 + shift && m.vanish.length == 2 && ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[1].y) ) { @@ -297,7 +293,7 @@ export class SchessRules extends ChessRules { } this.updateCastleFlags(move, piece); - const oppCol = V.GetOppCol(color); + const oppCol = this.turn; const firstRank = (color == 'w' ? 7 : 0); const oppFirstRank = 7 - firstRank; // Does this move turn off a piece init square flag?