From e396c037992fde2910fa2a8b3cd450b8a1e8bccb Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期一, 27 五月 2019 21:16:07 +0800
Subject: [PATCH] 3761 【2.0】仙盟联赛水晶无法采集

---
 Fight/GameActor/GA_NpcCollect.cs |    3 ++-
 Fight/PrepareHandler.cs          |    2 +-
 Fight/MapTransferUtility.cs      |   13 ++++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Fight/GameActor/GA_NpcCollect.cs b/Fight/GameActor/GA_NpcCollect.cs
index f46a9e6..b4aa6db 100644
--- a/Fight/GameActor/GA_NpcCollect.cs
+++ b/Fight/GameActor/GA_NpcCollect.cs
@@ -370,7 +370,8 @@
         else
         {
             if (ModelCenter.Instance.GetModel<HazyGrassModel>().IsInDungeon
-            || PlayerDatas.Instance.baseData.MapID == 31190)
+            || PlayerDatas.Instance.baseData.MapID == 31190
+            || PlayerDatas.Instance.baseData.MapID == 31220)
             {
                 m_CanCollect = true;
             }
diff --git a/Fight/MapTransferUtility.cs b/Fight/MapTransferUtility.cs
index 27741c9..56bfe55 100644
--- a/Fight/MapTransferUtility.cs
+++ b/Fight/MapTransferUtility.cs
@@ -858,7 +858,7 @@
         }
 
         // 閽堝鎸栨礊瀵硅薄淇濇寔璺濈涓�0
-        if (npc != null && _config.Dig == 1)
+        if (_config.Dig == 1)
         {
             _chkDist = 0;
         }
@@ -866,7 +866,7 @@
         // 澶т簬閰嶇疆鐨勮窛绂�, 绉诲姩鑷�
         if (_distSqrt > Mathf.Pow(_chkDist, 2))
         {
-            _hero.MoveToPosition(_destPos, _chkDist - 0.3f, true);
+            _hero.MoveToPosition(_destPos, _chkDist, true);
 
             if (s_OnHeroStartMoveToNPC != null)
             {
@@ -888,6 +888,13 @@
                     if (_collect != null)
                     {
                         PrepareHandler.Instance.Arrive(_collect);
+
+                        if (_distSqrt < Mathf.Pow(_collect.NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2))
+                        {
+                            NPCInteractProcessor.InvokeEvent(E_NpcType.Collect, _collect.NpcConfig.NPCID, _collect.ServerInstID);
+                            var _dir = MathUtility.ForwardXZ(_collect.Pos, _hero.Pos);
+                            _hero.Forward = _dir;
+                        }
                     }
                 }
                 else
@@ -1321,7 +1328,7 @@
                     {
                         if (_npc != null)
                         {
-                            if (_npc is GA_NpcClientFightNorm)
+                            if (_npc is GA_NpcCollect)
                             {
                                 NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID);
                             }
diff --git a/Fight/PrepareHandler.cs b/Fight/PrepareHandler.cs
index 4612b51..5098f92 100644
--- a/Fight/PrepareHandler.cs
+++ b/Fight/PrepareHandler.cs
@@ -149,7 +149,7 @@
 
                 _checkDis = MathUtility.DistanceSqrtXZ(_hero.Pos, _npc.Pos);
 
-                if (_checkDis < 4f)
+                if (_checkDis < Math.Pow(_npc.NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2))
                 {
                     NPCInteractProcessor.InvokeEvent(E_NpcType.Collect, _npc.NpcConfig.NPCID, _npc.ServerInstID);
                     var _dir = MathUtility.ForwardXZ(_npc.Pos, _hero.Pos);

--
Gitblit v1.8.0