From 011446acc659c24f4ce4cd34eec4643838cc7bc2 Mon Sep 17 00:00:00 2001 From: pan Date: Tue, 21 Jul 2026 09:44:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(CardComp):=20=E4=BF=AE=E5=A4=8D=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=8D=A1=E5=8A=A8=E7=94=BB=E5=8A=A0=E8=BD=BD=E7=AB=9E?= =?UTF-8?q?=E6=80=81=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除了对card_uuid、card_type的错误竞态校验,仅保留token判断,解决升级卡动画加载被误丢弃的问题 --- assets/script/game/map/CardComp.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/script/game/map/CardComp.ts b/assets/script/game/map/CardComp.ts index f01bf0f9..c681aa0d 100644 --- a/assets/script/game/map/CardComp.ts +++ b/assets/script/game/map/CardComp.ts @@ -982,8 +982,10 @@ export class CardComp extends CCComp { mLogger.log(this.debugMode, "CardComp", `load hero animation failed ${uuid}`, err); return; } - // 竞态保护:若加载期间卡面已变更则丢弃 - if (token !== this.iconVisualToken || !this.cardData || this.card_type !== CardType.Hero || this.card_uuid !== uuid) { + // 竞态保护:仅靠 token 判断。 + // 升级卡的 card_uuid(7001) / card_type(SpecialUpgrade) 与实际渲染的 + // hero uuid / Hero 类型不一致,不能用这些字段做校验,token 已足够。 + if (token !== this.iconVisualToken) { return; } this.clearAnimationClips(anim);