From cf12ea809cd7c5b063ae284afc76e175df83d62d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 21 一月 2025 18:56:58 +0800
Subject: [PATCH] 10263 【越南】【英文】【BT】【砍树】后端支持NPC仿真实玩家战斗和快速战斗(优化不创建战斗PK时玩家自身镜像数据同步;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py
index ef2477c..6673827 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py
@@ -117,14 +117,19 @@
     
     battle = MirrorAttack.GetMirrorBattleByID(battleID)
     if not battle:
+        GameWorld.DebugLog("镜像战斗结算时战场数据不存在!", battleID)
         return
     mapID = battle.mapID
     funcLineID = battle.funcLineID
     isWin = battle.isWin
     curPlayerID = battle.playerID # 副本所属玩家ID,该玩家不一定参与实际战斗
     tagPlayerID = battle.GetTagPlayerID()
-    curPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(curPlayerID)            
+    curPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(curPlayerID)
+    if not curPlayer: # 防范GetMapCopyPlayerManager找不到的情况,不在1线,系统后台战斗默认在1线,非1线玩家请求的情况
+        curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(curPlayerID)
+        
     if not curPlayer:
+        GameWorld.DebugLog("镜像战斗结算时所属玩家不在线! curPlayerID=%s" % curPlayerID, battleID)
         return
     
     if mapID == ChConfig.Def_FBMapID_ArenaBattle:

--
Gitblit v1.8.0