From 4a9d14488235958f09bd8db502b388b5b5dd6164 Mon Sep 17 00:00:00 2001 From: "ZM.J" Date: Thu, 11 Jul 2024 15:15:28 +0800 Subject: [PATCH] fix bug when group=0 --- apps/guide.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/guide.js b/apps/guide.js index 70d536d..126feab 100644 --- a/apps/guide.js +++ b/apps/guide.js @@ -1,11 +1,12 @@ +import path from 'path' +import fs from 'fs' +import fetch from 'node-fetch' +import lodash from 'lodash' +import common from '../../../lib/common/common.js' import {ZZZPlugin} from '../lib/plugin.js' import {rulePrefix} from '../lib/common.js' import {atlasToName} from '../lib/convert/char.js' -import path from 'path' -import fs from 'fs' import {imageResourcesPath} from '../lib/path.js' -import fetch from 'node-fetch' -import lodash from 'lodash' const ZZZ_GUIDES_PATH = path.join(imageResourcesPath, 'guides') @@ -43,6 +44,9 @@ export class Guide extends ZZZPlugin { ] // 最大攻略数量 this.maxNum = this.source.length + + // 最大显示攻略数量 + this.maxForwardGuides = 4 } async init () { @@ -98,7 +102,7 @@ export class Guide extends ZZZPlugin { msg.push(segment.image(`file://${guidePath}`)) continue } - if (i < 4 && await this.getImg(role, i)) { + if (i < this.maxForwardGuides && await this.getImg(name, i)) { msg.push(segment.image(`file://${guidePath}`)) } }