From 06bc988bceb9f01cd63304db0ce3d26c6aba2858 Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Mon, 22 Sep 2025 19:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8F=AF=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E7=9A=84=E6=8A=80=E5=B8=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/data/GirlData.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/Scripts/chat18x/data/GirlData.ts b/assets/Scripts/chat18x/data/GirlData.ts index 00f5d278..7aac925c 100644 --- a/assets/Scripts/chat18x/data/GirlData.ts +++ b/assets/Scripts/chat18x/data/GirlData.ts @@ -1010,15 +1010,17 @@ export class GirlData extends BaseData { /** 获取所有可聊天的技师 id */ public getAllCanChatGirlIds(): number[] { const result: number[] = []; + const seen = new Set(); // 用来去重 const cats = this.ensureCategories(); - + // 遍历 for (const [categoryId, bucket] of cats.entries()) { for (const girlId of bucket.girlIds) { - if (this.isCanChat(categoryId, girlId)) { + if (this.isCanChat(categoryId, girlId) && !seen.has(girlId)) { + seen.add(girlId); // 标记已加入 result.push(girlId); } } - } + } // 排序 // 1,都存在聊天记录,按照聊天时间从近到远,否则,有聊天记录的排在前面 // 2,都没有聊天记录