From b004dbe723a7d7cc426adfba25ab5df3c6fa7a36 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 27 十一月 2018 10:23:33 +0800
Subject: [PATCH] 2467 【BUG】【1.3】封魔坛次数购买可超过上限BUG

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

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index c3f52d5..801bb41 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -1694,7 +1694,12 @@
     canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
     
     hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
-  
+    maxDayTimes = ipyData.GetDayTimes()
+    maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
+    enterCnt = GetEnterFBCount(curPlayer, mapID)
+    if maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
+        GameWorld.DebugLog('当前次数已满,无需购买。。')
+        return
     if hasBuyCnt >= canBuyCnt:
         GameWorld.DebugLog("购买次数已经用完mapID=%s"%mapID)
         return
@@ -1716,9 +1721,7 @@
     PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
     lastRegainTime= curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
     if lastRegainTime:
-        maxDayTimes = ipyData.GetDayTimes()
         maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
-        enterCnt = GetEnterFBCount(curPlayer, mapID)
         if maxCnt - enterCnt == maxDayTimes:
             curTime = int(time.time())
             needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID)

--
Gitblit v1.8.0