Browse Source

【BUG】MMO-20617:没改啥不知道采莲为啥不战斗了,改了再说吧

meijun 3 years ago
parent
commit
70651e2fc8

+ 6 - 0
Common/CommonAI/Zone/Instance/InstancePlayer.cs

@@ -69,6 +69,7 @@ namespace CommonAI.Zone.Instance
             this.mUpdateMove = new StatePlayerUpdateMove(this);
             this.mCheckGuard = new TimeInterval<int>(Templates.CFG.AI_VIEW_TRIGGER_CHECK_TIME_MS);
         }
+
         protected override void Disposing()
         {
             /*
@@ -837,6 +838,11 @@ namespace CommonAI.Zone.Instance
 			}
 		}
 
+        public virtual void doEnterAutoFight()
+        {
+           this.IsGuard = true;
+        }
+
         protected virtual void doFollow(UnitFollowAction act)
         {
             this.mIsSkillControlByServer = act.follow || (mCurrentSyncMode != ZoneClient.SyncMode.MoveByClient_PreSkillByClient);

+ 8 - 0
XmdsCommonServer/Plugin/Units/XmdsInstancePlayer.cs

@@ -90,6 +90,14 @@ namespace XmdsCommonServer.Plugin.Units
 			this.OnHandleAction += OnActionHandle;
 		}
 
+		public override void doEnterAutoFight()
+		{
+			base.doEnterAutoFight();
+			this.IsGuard = true;
+			this.mGuardPos.SetX(this.X);
+			this.mGuardPos.SetY(this.Y);
+		}
+
 		static void OnActionHandle(InstanceUnit unit, ObjectAction act)
 		{
 			if (act is PlayerDramaEndAction && unit.AoiStatus != null)

+ 1 - 1
XmdsServerCS/XmdsServerNode/Node/ServerZoneNode.cs

@@ -240,7 +240,7 @@ namespace XmdsServerNode.Node
             //进去默认自动战斗的情况下
             if(this.SceneData.Properties.GetAutoFightFlag() == 3 && !client.Actor.IsGuard)
             {
-                client.Actor.IsGuard = true;
+                client.Actor.doEnterAutoFight();
             }
 
             client.Actor.Virtual.doEvent(JSGCustomOpType.UpdateAutoBattleFlag);