From ddd11f960524c64c880ccdda01af52370d8ae28c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 八月 2018 10:52:57 +0800
Subject: [PATCH] Fix: 1598 使用天机宝箱提示还需格子数异常问题

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_Chests.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_Chests.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_Chests.py
index 199fcec..1d2a550 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_Chests.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_Chests.py
@@ -62,7 +62,7 @@
     awardInfo = GetChestsAwardInfo(curPlayer, chestsItemID, useCnt, exData)
     if not awardInfo:
         return
-    needSpaceMax, needSpaceDict, jobAwardItemDict, moneyType, moneyCount, notifyItemList = awardInfo
+    needSpaceDict, jobAwardItemDict, moneyType, moneyCount, notifyItemList = awardInfo
     GameWorld.DebugLog("    needSpaceDict=%s,jobAwardItemDict=%s,moneyType=%s,moneyCount=%s,notifyItemList=%s" 
                        % (needSpaceDict, jobAwardItemDict, moneyType, moneyCount, notifyItemList))
     
@@ -70,7 +70,7 @@
         packSpace = ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace)
         if packSpace < needSpace:
             #PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packType])
-            PlayerControl.NotifyCode(curPlayer, "OpenBoxItem", [packType, chestsItemID, needSpaceMax - packSpace])
+            PlayerControl.NotifyCode(curPlayer, "OpenBoxItem", [packType, chestsItemID, needSpace - packSpace])
             return
         
     # 扣除消耗
@@ -115,14 +115,13 @@
 def GetChestsAwardInfo(curPlayer, chestsItemID, useCount, exData=0):
     '''获取宝箱开启奖励
     @return: None - 获取宝箱奖励失败
-    @return: needSpaceMax, needSpaceDict, jobAwardItemDict{itemID:itemCount, ...}
+    @return: needSpaceDict, jobAwardItemDict{itemID:itemCount, ...}
     '''
     
     awardIpyData = __GetChestsAwardIpyDataByLV(curPlayer, chestsItemID)
     if not awardIpyData:
         return
     
-    needSpaceMax = 0
     awardItemDict = {}
     job = curPlayer.GetJob()
     jobItemList = awardIpyData.GetJobItemList()
@@ -147,25 +146,21 @@
         if not isSelectOK:
             GameWorld.ErrLog("选择的物品错误, 该宝箱没有该物品!chestsItemID=%s,selectItemID=%s" % (chestsItemID, selectItemID))
             return
-        needSpaceMax += 1
         
     # 固定产出物品
     if awardIpyData.GetFixedItemDict():
         for itemID, itemCount in awardIpyData.GetFixedItemDict().items():
-            needSpaceMax += 1
             __AddAwardItem(awardItemDict, itemID, itemCount * useCount)
             
     # 随机物品库1
     if awardIpyData.GetRandItemList1() and awardIpyData.GetRandTimeList1():
         if not __AddChestsRandAwardItem(curPlayer, chestsItemID, useCount, awardItemDict, awardIpyData.GetRandItemList1(), awardIpyData.GetRandTimeList1()):
             return
-        needSpaceMax += __GetMaxRandTime(awardIpyData.GetRandTimeList1())
         
     # 随机物品库2
     if awardIpyData.GetRandItemList2() and awardIpyData.GetRandTimeList2():
         if not __AddChestsRandAwardItem(curPlayer, chestsItemID, useCount, awardItemDict, awardIpyData.GetRandItemList2(), awardIpyData.GetRandTimeList2()):
             return
-        needSpaceMax += __GetMaxRandTime(awardIpyData.GetRandTimeList2())
     
     # 产出特殊物品广播
     needNotifyItemList = awardIpyData.GetNeedNotifyItemList()
@@ -190,7 +185,7 @@
         if itemID in needNotifyItemList or jobItemID in needNotifyItemList:
             notifyItemList.append(jobItemID)
             
-    return needSpaceMax, needSpaceDict, jobAwardItemDict, awardIpyData.GetMoneyType(), awardIpyData.GetMoneyCount() * useCount, notifyItemList
+    return needSpaceDict, jobAwardItemDict, awardIpyData.GetMoneyType(), awardIpyData.GetMoneyCount() * useCount, notifyItemList
 
 def __GetMaxRandTime(randTimeList):
     if len(randTimeList) == 1 and type(randTimeList[0]) == int:

--
Gitblit v1.8.0