@@ -180,8 +180,9 @@ async function processPathings() {
180180
181181 // 去除重复标签
182182 pathing . tags = [ ...new Set ( pathing . tags ) ] ;
183+ // 处理 map_name 属性
184+ pathing . map_name = parsedContent . info ?. map_name || "Teyvat" ; // 如果有 map_name,则使用其值,否则默认为 "Teyvat"
183185 }
184-
185186 return pathings ; // 返回处理后的 pathings 数组
186187}
187188
@@ -343,7 +344,11 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
343344
344345 // 为最终选中且精英怪数量为0的路线添加小怪标签
345346 pathings . forEach ( pathing => {
346- if ( pathing . selected && pathing . e === 0 ) {
347+ // 检查是否包含 "传奇" 或 "高危" 标签
348+ const hasLegendOrHighRisk = pathing . tags . includes ( "传奇" ) || pathing . tags . includes ( "高危" ) ;
349+
350+ // 如果路径被选中、没有精英怪物且不包含 "传奇" 或 "高危" 标签,则添加 "小怪" 标签
351+ if ( pathing . selected && pathing . e === 0 && ! hasLegendOrHighRisk ) {
347352 pathing . tags . push ( "小怪" ) ;
348353 }
349354 } ) ;
@@ -810,7 +815,7 @@ async function processPathingsByGroup(pathings, targetTexts, blacklistKeywords,
810815 await fakeLog ( `${ pathing . fileName } ` , false , false , 0 ) ;
811816
812817 try {
813- const miniMapPosition = await genshin . getPositionFromMap ( ) ;
818+ const miniMapPosition = await genshin . getPositionFromMap ( pathing . map_name ) ;
814819 // 比较坐标
815820 const diffX = Math . abs ( lastX - miniMapPosition . X ) ;
816821 const diffY = Math . abs ( lastY - miniMapPosition . Y ) ;
@@ -819,14 +824,19 @@ async function processPathingsByGroup(pathings, targetTexts, blacklistKeywords,
819824 if ( ( diffX + diffY ) < 5 ) {
820825 runningFailCount ++ ;
821826 } else {
822- //log.info(`当前坐标(${miniMapPosition.X},${miniMapPosition.Y},距离上次距离${(diffX + diffY)}`)
823827 runningFailCount = 0 ;
824828 }
829+ //log.info(`当前位于${pathing.map_name}地图的(${miniMapPosition.X},${miniMapPosition.Y},距离上次距离${(diffX + diffY)}`);
825830 } catch ( error ) {
826831 log . error ( `执行任务时发生错误:${ error . message } ` ) ;
827832 runningFailCount ++ ;
828833 }
829834
835+ if ( runningFailCount >= 1 ) {
836+ log . error ( "连续两条路线终止时坐标不变,不记录运行数据" ) ;
837+ continue ;
838+ }
839+
830840 // 计算下一个 UTC 时间的晚上 8 点(即北京时间凌晨四点)
831841 const nextEightClock = new Date ( now ) ;
832842 nextEightClock . setUTCHours ( 20 , 0 , 0 , 0 ) ; // 设置为 UTC 时间的 20:00
@@ -847,11 +857,6 @@ async function processPathingsByGroup(pathings, targetTexts, blacklistKeywords,
847857 const remainingseconds = predictRemainingTime % 60 ;
848858 log . info ( `当前进度:第 ${ targetGroup } 组第 ${ groupPathCount } /${ totalPathsInGroup } 个 ${ pathing . fileName } 已完成,该组预计剩余: ${ remaininghours } 时 ${ remainingminutes } 分 ${ remainingseconds . toFixed ( 0 ) } 秒` ) ;
849859
850- if ( runningFailCount >= 1 ) {
851- log . error ( "连续两条路线终止时坐标不变,暂时不记录运行数据" ) ;
852- continue ;
853- }
854-
855860 await updateCdTimeRecord ( pathings , accountName ) ;
856861 }
857862 }
0 commit comments