From 5d75734ef21459105f89bc8a0d4d235c8c137e62 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 24 十月 2025 17:45:43 +0800
Subject: [PATCH] 0312 无蒙版点击不需要判断镂空;防范断线重连报错

---
 Main/System/Main/MainWin.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 429a2d9..c6b6bd0 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -327,8 +327,12 @@
             cdTween.SetStartState();
             cdTween.Play(() =>
             {
-                AutoFightModel.Instance.fightingHeroSkinID = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid).SkinID;
-                fightHeroImg.SetOrgSprite(HeroSkinConfig.Get(AutoFightModel.Instance.fightingHeroSkinID).SquareIcon, "HeroHead");
+                var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
+                if (tmpHero != null)
+                {
+                    AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID;
+                    fightHeroImg.SetOrgSprite(HeroSkinConfig.Get(AutoFightModel.Instance.fightingHeroSkinID).SquareIcon, "HeroHead");
+                }
             });
             fightHeroScale.SetStartState();
             fightHeroScale.Play();
@@ -343,10 +347,13 @@
 
         if (AutoFightModel.Instance.fightingHeroSkinID == 0)
         {
-            AutoFightModel.Instance.fightingHeroSkinID = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid).SkinID;
+            var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
+            if (tmpHero != null)
+            {
+                AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID;
+                fightHeroImg.SetOrgSprite(HeroSkinConfig.Get(AutoFightModel.Instance.fightingHeroSkinID).SquareIcon, "HeroHead");
+            }
         }
-
-        fightHeroImg.SetOrgSprite(HeroSkinConfig.Get(AutoFightModel.Instance.fightingHeroSkinID).SquareIcon, "HeroHead");
     }
 
     void OnSkillCast(bool isfighting)

--
Gitblit v1.8.0