A sorter site for Idolm@ster Characters
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bugfix on autopick logic

execfera 99e4482e 48ea8c43

+5 -5
+5 -5
src/js/main.js
··· 239 239 document.querySelector('.right.sort.text > p').innerHTML = rightChar.name; 240 240 241 241 /** Autopick if choice has been given. */ 242 - if (choices.length + 1 > battleNo) { 242 + if (choices.length !== battleNo - 1) { 243 243 switch (Number(choices[battleNo - 1])) { 244 244 case 0: pick('left'); break; 245 245 case 1: pick('right'); break; ··· 255 255 * @param {'left'|'right'|'tie'} sortType 256 256 */ 257 257 function pick(sortType) { 258 - if (timeTaken && !(choices.length + 1 > battleNo) || loading) { return; } 258 + if ((timeTaken && choices.length === battleNo - 1) || loading) { return; } 259 259 else if (!timestamp) { return start(); } 260 260 261 261 sortedIndexListPrev = sortedIndexList.slice(0); ··· 280 280 */ 281 281 switch (sortType) { 282 282 case 'left': { 283 - if (!(choices.length + 1 > battleNo)) { choices += '0'; } 283 + if (choices.length === battleNo - 1) { choices += '0'; } 284 284 recordData('left'); 285 285 while (tiedDataList[recordDataList[pointer - 1]] != -1) { 286 286 recordData('left'); ··· 288 288 break; 289 289 } 290 290 case 'right': { 291 - if (!(choices.length + 1 > battleNo)) { choices += '1'; } 291 + if (choices.length === battleNo - 1) { choices += '1'; } 292 292 recordData('right'); 293 293 while (tiedDataList[recordDataList [pointer - 1]] != -1) { 294 294 recordData('right'); ··· 304 304 * as if we picked the 'right' character. 305 305 */ 306 306 case 'tie': { 307 - if (!(choices.length + 1 > battleNo)) { choices += '2'; } 307 + if (choices.length === battleNo - 1) { choices += '2'; } 308 308 recordData('left'); 309 309 while (tiedDataList[recordDataList[pointer - 1]] != -1) { 310 310 recordData('left');