From 6893e76bead0494a83da293a6ee229eebb780d0b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 10 五月 2021 14:11:28 +0800
Subject: [PATCH] 8932 【BT2】【主干】【后端】物品转移背包类型后,支持上线刷新(神兽购买助战位动态获取出战石背包)

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

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
index 7f4372d..f7398cf 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -335,11 +335,16 @@
     needCountList = IpyGameDataPY.GetFuncEvalCfg("DogzAssist", 3)
     needCount = needCountList[-1] if helpbattleBuyCount >= len(needCountList) else needCountList[helpbattleBuyCount]
     
-    costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, needItemID)
-    if bindCnt + unBindCnt < needCount:
-        GameWorld.DebugLog("购买神兽助战位所需道具不足 !needItemID=%s,needCount=%s" % (needItemID, needCount), playerID)
+    itemData = GameWorld.GetGameData().GetItemByTypeID(needItemID)
+    if not itemData:
         return
-    ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, needCount, "DogzBuyHelpFight")
+    
+    packType = ChConfig.GetItemPackType(itemData)
+    costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, needItemID, packType=packType)
+    if bindCnt + unBindCnt < needCount:
+        GameWorld.DebugLog("购买神兽助战位所需道具不足 !needItemID=%s,needCount=%s,packType=%s" % (needItemID, needCount, packType), playerID)
+        return
+    ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, needCount, "DogzBuyHelpFight", packType=packType)
     
     updBuyCount = helpbattleBuyCount + 1
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DogzBuyHelpbattleCount, updBuyCount)

--
Gitblit v1.8.0