mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-28 05:29:52 +08:00
fix(AutoPlan): 修复数组越界检查逻辑
- 将条件判断从 index < arr.length 修改为 index <= arr.length-1 - 防止在解析配置数组时发生索引越界错误 - 确保所有可选配置项都能正确解析而不会抛出异常
This commit is contained in:
@@ -254,7 +254,7 @@ async function loadMode(Load, autoOrderSet, runConfig) {
|
||||
let domainRoundNum = arr[index]; // 解析副本轮数
|
||||
index++
|
||||
let sundaySelectedValue = "1"
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
sundaySelectedValue = arr[index]; // 解析周日|限时选择的值
|
||||
|
||||
// 检查秘境名称是否有效
|
||||
@@ -265,7 +265,7 @@ async function loadMode(Load, autoOrderSet, runConfig) {
|
||||
if (!domainNameTemp) {
|
||||
throw new Error(`${domainName} 输入错误`);
|
||||
}
|
||||
if (index < arr.length) {
|
||||
if (index <= arr.length-1) {
|
||||
const domainSelectedValue = parseInt(config.domainOrderMap.get(domainName) + "");
|
||||
sundaySelectedValue = domainSelectedValue
|
||||
}
|
||||
@@ -306,25 +306,25 @@ async function loadMode(Load, autoOrderSet, runConfig) {
|
||||
index++
|
||||
autoLeyLineOutcrop.leyLineOutcropType = arr[index]
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.friendshipTeam = arr[index]
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.useFragileResin = arr[index].trim() !== ""
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.useTransientResin = arr[index].trim() !== ""
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.isGoToSynthesizer = arr[index].trim() !== ""
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.useAdventurerHandbook = arr[index].trim() !== ""
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.isNotification = arr[index].trim() !== ""
|
||||
index++
|
||||
if (index < arr.length)
|
||||
if (index <= arr.length-1)
|
||||
autoLeyLineOutcrop.timeout = parseInteger(arr[index])
|
||||
|
||||
autoOrder.autoLeyLineOutcrop = autoLeyLineOutcrop // 将地脉信息对象添加到顺序对象中
|
||||
|
||||
Reference in New Issue
Block a user