- const saveFlags = JSON.stringify(this.castleFlags[c]);
- // Alter flags to follow base_rules semantic
- this.castleFlags[c] = [0, 3].map(i => this.castleFlags[c][i]);
- const moves = super.getCastleMoves([x, y], finalSquares);
- this.castleFlags[c] = JSON.parse(saveFlags);
+ const moves =
+ super.getCastleMoves([x, y], finalSquares, null, this.castleFlags[p]);