Bladeren bron

【优化】PVP状态定义为:主体为人的单位

meijun 3 jaren geleden
bovenliggende
commit
92ff1567b1
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.cs

+ 3 - 3
XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.cs

@@ -1123,7 +1123,7 @@ namespace XmdsCommonServer.Plugin
 
         protected virtual void ChangeCombatStateFromAtk(XmdsVirtual target)
         {
-            var s = target.IsPlayerUnit() ? BattleStatus.PVP : BattleStatus.PVE;
+            var s = (this.IsPlayerUnit() && target.IsPlayerUnit()) ? BattleStatus.PVP : BattleStatus.PVE;
             SetCombatState(s, 0, target.mUnit.PlayerUUID);
         }
 
@@ -1375,7 +1375,7 @@ namespace XmdsCommonServer.Plugin
                         //攻击者进度战斗状态.
                         attacker.ChangeCombatStateFromAtk(this);
                         mHateSystem.OnHitted(attacker, this, damage, ref result);
-                        var v = attacker.IsPlayerUnit() ? BattleStatus.PVP : BattleStatus.PVE;
+                        var v = (this.IsPlayerUnit() && attacker.IsPlayerUnit()) ? BattleStatus.PVP : BattleStatus.PVE;
 
                         //单位被攻击,且从PVE状态转为PVP状态,
                         if (v == BattleStatus.PVP && CombatState != BattleStatus.PVP)
@@ -1416,7 +1416,7 @@ namespace XmdsCommonServer.Plugin
                     //致命一击时候死亡状态不设置.
                     if (this.mUnit.CurrentHP - damage > 0)
                     {
-                        var s = attacker.IsPlayerUnit() ? BattleStatus.PVP : BattleStatus.PVE;
+                        var s = (this.IsPlayerUnit() && attacker.IsPlayerUnit()) ? BattleStatus.PVP : BattleStatus.PVE;
 
                         //单位被攻击,且从PVE状态转为PVP状态,
                         if (s == BattleStatus.PVP && CombatState != BattleStatus.PVP)