From 71ea04a0d2f445b3b3947175bacc6829a5996af9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 25 三月 2019 21:26:48 +0800
Subject: [PATCH] 6385 【后端】【2.0】五行灵根开发(修复洗点报错 )

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
index a43d19e..f042785 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
@@ -381,6 +381,7 @@
     rolePet.SetMinAtk(PlayerControl.GetPetMinAtk(curPlayer))
     rolePet.SetMaxAtk(PlayerControl.GetPetMaxAtk(curPlayer))
     rolePet.SetSkillAtkRate(PlayerControl.GetPetSkillAtkRate(curPlayer))
+    GameObj.SetPetDamPer(rolePet, GameObj.GetPetDamPer(curPlayer))
     #rolePet.SetMAtkMin(curPlayer.GetMAtkMin())
     #rolePet.SetMAtkMax(curPlayer.GetMAtkMax())
     rolePet.SetHit(curPlayer.GetHit())
@@ -516,13 +517,23 @@
 def DoLogic_PetInfo_OnLogin(curPlayer, tick):
    
     petMgr = curPlayer.GetPetMgr()
-
-    for index in range(0, petMgr.PetList_Cnt()):
-        rolePet = petMgr.PetList_At(index)
-        #刷新宠物信息并通知客户端
-        __RefreshAndSyncPetInfo(rolePet)
-        #自动出战宠物
-        __AutoSummonPet_OnLogin(curPlayer, rolePet)
+    if GameWorld.IsCrossServer():
+        ''' 0435宠物出现包同步的ID是根据宠物的列表位置来的,比如在第2位发的就是2,而地图的可能是1,会导致ID不一致
+                            所以跨服服务器登录时先清除出战宠物列表,确保登录地图成功后都是从1开始的即可
+        '''
+        petList = []
+        for index in range(0, petMgr.PetList_Cnt()):
+            rolePet = petMgr.PetList_At(index)
+            petList.append(rolePet)
+        for rolePet in petList:
+            petMgr.PetList_SetFree(rolePet.GetRolePet().PetID)
+    else:
+        for index in range(0, petMgr.PetList_Cnt()):
+            rolePet = petMgr.PetList_At(index)
+            #刷新宠物信息并通知客户端
+            __RefreshAndSyncPetInfo(rolePet)
+            #自动出战宠物
+            __AutoSummonPet_OnLogin(curPlayer, rolePet)
 
     return
 #---------------------------------------------------------------------

--
Gitblit v1.8.0