- if (this.kingPos[oppCol][0] < 0) {
- // Last move took opponent's king
- for (let psq of move.vanish) {
- if (psq.p == "k") {
- this.kingPos[oppCol] = [psq.x, psq.y];
- break;
- }
- }
- }
+ if (this.kingPos[oppCol][0] < 0)
+ // Last move took opponent's king:
+ this.kingPos[oppCol] = [move.vanish[1].x, move.vanish[1].y];