Procházet zdrojové kódy

修复当法术PType = POS_TYPE_FAN且Count =1时,会导致法术不显示的bug

大爷 před 1 rokem
rodič
revize
fb9369ba50

+ 3 - 3
Common/CommonAI/Zone/Instance/InstanceZone.cs

@@ -1948,7 +1948,7 @@ namespace CommonAI.Zone.Instance
                         case LaunchSpell.PosType.POS_TYPE_FAN:
                             {
                                 float startAngle = direction - launch.Angle / 2f;// + launch.StartAngle;
-                                float interAngle = launch.Count > 0 ? launch.Angle / (launch.Count - 1) : 0;
+                                float interAngle = launch.Count > 1 ? launch.Angle / (launch.Count - 1) : 0;
                                 for (int i = 0; i < launch.Count; i++)
                                 {
                                     AddSpell(fromSkillType, spell, launch, launcher, launcher,
@@ -2129,7 +2129,7 @@ namespace CommonAI.Zone.Instance
                         case LaunchSpell.PosType.POS_TYPE_FAN:
                             {
                                 float startAngle = direction - launch.Angle / 2f + launch.StartAngle;
-                                float interAngle = launch.Count > 0 ? launch.Angle / (launch.Count - 1) : 0;
+                                float interAngle = launch.Count > 1 ? launch.Angle / (launch.Count - 1) : 0;
                                 for (int i = 0; i < launch.Count; i++)
                                 {
                                     AddSpell(fromSkillType, spell, launch, sender, sender.Launcher,
@@ -2259,7 +2259,7 @@ namespace CommonAI.Zone.Instance
                         case LaunchSpell.PosType.POS_TYPE_FAN:
                             {
                                 float startAngle = sender.Direction - launch.Angle / 2f + launch.StartAngle;
-                                float interAngle = launch.Count > 0 ? launch.Angle / (launch.Count - 1) : 0;
+                                float interAngle = launch.Count > 1 ? launch.Angle / (launch.Count - 1) : 0;
                                 for (int i = 0; i < launch.Count; i++)
                                 {
                                     AddSpell(fromSkillType, spell, launch, sender, attacker, damage.ID, null,

+ 5 - 2
Common/CommonAI/ZoneClient/ZoneLayer.cs

@@ -759,6 +759,10 @@ namespace CommonAI.ZoneClient
                 ret.TargetPos = e.target_pos;
                 addObj(ret);
             }
+            else
+            {
+                log.Error($"Not found spell template :{e.spell_template_id}");
+            }
         }
 
         private void doAddItemEvent(AddItemEvent e)
@@ -942,10 +946,9 @@ namespace CommonAI.ZoneClient
                 mObjectes.Add(obj);
                 SwapSpace(obj);
                 obj.OnAdded();
-                //doZoneEvent(ZoneEvent.ADD_OBJ, obj, null);
                 if (mObjectEnter != null)
                 {
-                    mObjectEnter.Invoke(this, obj as ZoneObject);
+                    mObjectEnter.Invoke(this, obj);
                 }
                 if (obj == mActor)
                 {