From ec68dabc97521a7706344e7d038e9f08462f4fe8 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 十二月 2025 10:26:34 +0800
Subject: [PATCH] 16 卡牌服务端(删除多余备档报错防范;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
index b4ea635..cdd0ca1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
@@ -23,7 +23,6 @@
 import ItemControler
 import PlayerBeauty
 import GameWorld
-import ObjPool
 
 import random
 import time
@@ -258,16 +257,7 @@
 def __doClickUnOpendGrid(curPlayer, row, col):
     ## 执行点击未开启的格子
     gridState = GetGridState(curPlayer, row, col)
-    if gridState == GridState_None:
-        crackRate = IpyGameDataPY.GetFuncCfg("TravelRate", 1)
-        if GameWorld.CanHappen(crackRate):
-            GameWorld.DebugLog("触发裂纹: row=%s,col=%s,crackRate=%s" % (row, col, crackRate))
-            SetGridState(curPlayer, row, col, GridState_Crack)
-        else:
-            __openGridRandEvent(curPlayer, row, col)
-            
-    # 再次点击裂纹
-    elif gridState == GridState_Crack:
+    if gridState in [GridState_None, GridState_Crack]:
         __openGridRandEvent(curPlayer, row, col)
     else:
         return
@@ -275,9 +265,9 @@
 
 def __openGridRandEvent(curPlayer, row, col):
     ## 执行打开格子随机生成事件
-    SetGridState(curPlayer, row, col, GridState_Opend)
     eventID = GetGridEventID(curPlayer, row, col)
     if eventID:
+        SetGridState(curPlayer, row, col, GridState_Opend)
         GameWorld.DebugLog("该游历格子已经有事件ID了! row=%s,col=%s,eventID=%s" % (row, col, eventID))
         return
     
@@ -296,12 +286,19 @@
         eventID = EventID_Blank
     else:
         eventID = ipyData.GetEventID()
-        if ipyData.GetAwardItemID():
+        awardItemID = ipyData.GetAwardItemID()
+        if awardItemID in IpyGameDataPY.GetFuncEvalCfg("TravelRate", 1) and GetGridState(curPlayer, row, col) == GridState_None:
+            GameWorld.DebugLog("必出现裂纹的奖励事件! eventID=%s,awardItemID=%s" % (eventID, awardItemID))
+            SetGridState(curPlayer, row, col, GridState_Crack)
+            
+        if awardItemID:
             multiRate = IpyGameDataPY.GetFuncCfg("TravelRate", 2)
             if GameWorld.CanHappen(multiRate):
                 multi = 2
     SetGridMulti(curPlayer, row, col, multi)
     SetGridEventID(curPlayer, row, col, eventID)
+    if GetGridState(curPlayer, row, col) == GridState_None:
+        SetGridState(curPlayer, row, col, GridState_Opend)
     GameWorld.DebugLog("随机格子事件: row=%s,col=%s,eventID=%s,multi=%s" % (row, col, eventID, multi))
     return
 
@@ -366,6 +363,9 @@
         for col in range(1, 1 + colMax):
             eventID = GetGridEventID(curPlayer, row, col)
             if eventID in SpecEventIDList or eventID < EventID_Portal:
+                continue
+            if GetGridState(curPlayer, row, col) != GridState_Opend:
+                #GameWorld.DebugLog("    未开启的格子: row=%s,col=%s,eventID=%s" % (row, col, eventID))
                 continue
             ipyData = IpyGameDataPY.GetIpyGameDataNotLog("TravelEvent", eventID)
             if not ipyData:
@@ -480,7 +480,7 @@
                 
     gridList = []
     for row, col in syncGridList:
-        grid = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelGrid)
+        grid = ChPyNetSendPack.tagSCTravelGrid()
         grid.Row = row
         grid.Col = col
         grid.State = GetGridState(curPlayer, row, col)
@@ -489,7 +489,7 @@
         gridList.append(grid)
         
     sceneryType, sRow, sCol = __getSceneryInfo(curPlayer)
-    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelInfo)
+    clientPack = ChPyNetSendPack.tagSCTravelInfo()
     clientPack.Energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy)
     clientPack.EnergyTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergyTime)
     clientPack.TravelCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelCnt)

--
Gitblit v1.8.0