Browse Source

修复了不能移动的monster单位,会进入guardInPosition状态的问题

大爷 1 year ago
parent
commit
6da4664136
1 changed files with 4 additions and 7 deletions
  1. 4 7
      Common/CommonAI/Zone/Instance/InstanceNpcs.cs

+ 4 - 7
Common/CommonAI/Zone/Instance/InstanceNpcs.cs

@@ -260,7 +260,7 @@ namespace CommonAI.Zone.Instance
         /// </summary>
         public virtual void guard()
         {
-            if(mHateSystem != null)
+            if(mHateSystem != null && mHateSystem.Count > 0)
             {
                 if (followAndAttack(mHateSystem.GetHated(), AttackReason.Tracing))
                 {
@@ -279,13 +279,10 @@ namespace CommonAI.Zone.Instance
                 changeState(this.mRunningPath);
                 return;
             }
-            if (mHateSystem != null)
+            if (Moveable && MoveSpeedSEC > 0)
             {
-                if (mHateSystem.Count == 0)
-                {
-                    guardInPosition(mOrginPosition);
-                    return;
-                }
+                guardInPosition(mOrginPosition);
+                return;
             }
             base.startIdle();
         }