- randIndex_tmp = 2 * randInt(4) + 1;
- bishopSameColorPos = (bishop1Pos % 2 == 0 ? bishop1Pos : bishop2Pos);
- if (randIndex_tmp >= bishopSameColorPos) randIndex_tmp += 2;
- const champion2Pos = positions[randIndex_tmp];
- positions.splice(Math.max(randIndex, randIndex_tmp), 1);
- positions.splice(Math.min(randIndex, randIndex_tmp), 1);
+ let randIndex_tmpC = 2 * randInt(4) + 1;
+ if (randIndex_tmpC >= bishop2Pos) randIndex_tmpC += 2;
+ const champion2Pos = positions[randIndex_tmpC];
+
+ let usedIndices = [randIndex, randIndex_tmp, randIndexC, randIndex_tmpC];
+ usedIndices.sort();
+ for (let i = 3; i >= 0; i--) positions.splice(usedIndices[i], 1);