From 798bc73b6665814f46cb1b138c3ee8a5574912cf Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 27 二月 2025 22:36:56 +0800
Subject: [PATCH] 10350 【GM】【越南】【英文】【BT】【砍树】跨服竞技场优化(没有匹配到机器人时概率直接匹配到机器人)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py
index 67b2687..af170b4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py
@@ -587,6 +587,7 @@
     GameWorld.DebugLog("积分榜可匹配的排名玩家ID列表: %s,%s" % (len(loopBillPlayerIDList), loopBillPlayerIDList), playerID)
     randPackPlayerIDList = None # 可随机匹配的打包数据战力排名玩家ID列表
     
+    haveRobot = False
     for matchIndex in range(matchCount):
         GameWorld.DebugLog("匹配第%s个: matchIndex=%s,playerBillIndex=%s,billLoopIndexList=%s" % (matchIndex + 1, matchIndex, playerBillIndex, billLoopIndexList), playerID)
         matchID = 0
@@ -619,9 +620,16 @@
         # 3. 最终还没有,直接机器人
         if not matchID:
             matchID = matchIndex + 1 # 机器人ID固定为 matchIndex + 1
+            haveRobot = True
         matchIDList.append(matchID)
         GameWorld.DebugLog("        本段随机匹配结果: matchIndex=%s,matchID=%s,randIDList=%s,matchIDList=%s" % (matchIndex, matchID, randIDList, matchIDList), playerID)
         
+    #最后一个如果不是机器人,则概率直接匹配机器人
+    if not haveRobot and GameWorld.CanHappen(IpyGameDataPY.GetFuncCfg("CrossRealmPKMatch3", 3)):
+        robotID = matchCount
+        matchIDList[-1] = robotID
+        GameWorld.DebugLog("没有匹配到机器人,概率直接匹配到机器人: robotID=%s" % robotID, playerID)
+        
     GameWorld.DebugLog("最终匹配结果: matchIDList=%s" % str(matchIDList), playerID)
     return matchIDList
 

--
Gitblit v1.8.0