- if (kingSymb.includes(c))
- this.kingPos["b"] = [i, k];
- // Not "else if", in case of two kings dancing together
- if (kingSymb.some(s => c == s.toUpperCase()))
- this.kingPos["w"] = [i, k];
- if (readNext) j++;
+ if (lowR == 'k') this.kingPos[c == 'k' ? 'b' : 'w'] = [i, k];
+ else if (readNext) {
+ const up = this.getUnionPieces(fenRows[i][++j], lowR);
+ if (up.w == V.KING) this.kingPos['w'] = [i, k];
+ if (up.b == V.KING) this.kingPos['b'] = [i, k];
+ }