From 1191d5eb74dfabf16accc9a1e15573e217def7a6 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期三, 26 十二月 2018 17:00:06 +0800 Subject: [PATCH] 5372 【后端】【1.4】聚魂副本开发(物品给错背包修复) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GatherSoul.py | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GatherSoul.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GatherSoul.py index 4d1f7c9..7a8ecac 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GatherSoul.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GatherSoul.py @@ -575,15 +575,27 @@ GameWorldProcess.CloseFB(tick) return - needSpace = len(totalItemList) - emptySpace = ItemCommon.GetItemPackSpace(curPlayer, ShareDefine.rptGatherSoul, needSpace) - isSendMail = int(needSpace > emptySpace) # 是否发送邮件 + needPackSpaceDict = {} + for itemID, itemCnt, isBind in totalItemList: + curItem = GameWorld.GetGameData().GetItemByTypeID(itemID) + if not curItem: + return + packType = ChConfig.GetItemPackType(curItem.GetType()) + needSpace = ItemControler.GetItemNeedPackCount(packType, curItem, itemCnt) + needPackSpaceDict[packType] = needPackSpaceDict.get(packType, 0) + needSpace + + isSendMail = False #是否背包不足 + for packType, needSpace in needPackSpaceDict.items(): + if needSpace > ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace): + isSendMail = True + break + if isSendMail: PlayerControl.SendMailByKey('JHBagFull2', [curPlayer.GetPlayerID()], totalItemList) GameWorld.DebugLog("背包空间不够,发送邮件: mailItemList=%s" % str(totalItemList), curPlayer.GetPlayerID()) else: for itemID, itemCnt, isBind in totalItemList: - ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [ShareDefine.rptGatherSoul], + ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [], event=["GatherSoulFB", False, {}]) fbCfg = GetGatherSoulFBCfg() -- Gitblit v1.8.0