Browse Source

修复一个高度有变化的spell创建子spell时,高度始终不正确的bug

大爷 1 year ago
parent
commit
54913db83c
1 changed files with 8 additions and 13 deletions
  1. 8 13
      Common/CommonAI/Zone/Instance/InstanceSpell.cs

+ 8 - 13
Common/CommonAI/Zone/Instance/InstanceSpell.cs

@@ -192,24 +192,19 @@ namespace CommonAI.Zone.Instance
         {
             get
             {
-                if (mSender != null && mSender is InstanceSpell)
+                if (mSender is InstanceSpell spell && spell.mInfo.MType == SpellTemplate.MotionType.Cannon)
                 {
-                    var obj = mSender as InstanceSpell;
-                    if (obj.mInfo.MType == SpellTemplate.MotionType.Cannon)
-                    {
-                        return 0;
-                    }
-                    else
-                    {
-                        return mSender.Z;
-                    }
+                    return 0;
                 }
-                float h = mLaunchData.LaunchSpellHeight;
                 if (mLaunchData.FromUnitBody)
                 {
-                    h = Launcher.Info.LaunchSpellHeight;
+					//TODO: 此时的Z并不是spell的实际高度位置
+                    return mSender.Z;
+                }
+                else
+                {
+                    return mLaunchData.LaunchSpellHeight;
                 }
-                return h;
             }
         }