From fd6fd0602d6dffa638bdd9bdcb46445a9430520e Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 23 十月 2018 19:10:36 +0800
Subject: [PATCH] 4283 增加法宝经验物品删除处理
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCompensationTube.py | 28 ++++++++++------------------
1 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCompensationTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCompensationTube.py
index 3d9dc44..3a508cc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCompensationTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCompensationTube.py
@@ -68,9 +68,8 @@
GameWorld.DebugLog(" PlayerID %s no found "%curPackData.PlayerID)
return
+ needPackSpaceDict = {}
isPackSpaceEnough = True
- commPackItemCount = 0 # 常规背包物品个数
- RuneItemCount = 0 # 符印物品个数
# 先汇总物品所属背包
for i in xrange(curPackData.Count):
curPackItem = curPackData.Items[i]
@@ -78,24 +77,17 @@
curItemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
if not curItemData:
continue
- if curItemData.GetType() in [ChConfig.Def_ItemType_Rune, ChConfig.Def_ItemType_RuneExp]:
- RuneItemCount += curPackItem.Count
- else:
- commPackItemCount += 1
+
+ packType = ChConfig.GetItemPackType(curItemData.GetType())
+ needSpace = ItemControler.GetItemNeedPackCount(packType, curItemData, curPackItem.Count)
+ needPackSpaceDict[packType] = needPackSpaceDict.get(packType, 0) + needSpace
- if isPackSpaceEnough and RuneItemCount > 0:
- packSpace = ItemCommon.GetItemPackSpace(curPlayer, ShareDefine.rptRune, RuneItemCount)
- if packSpace < RuneItemCount:
+ GameWorld.DebugLog(" needPackSpaceDict=%s" % str(needPackSpaceDict))
+ for packType, needSpace in needPackSpaceDict.items():
+ if needSpace > ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace):
+ PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packType])
isPackSpaceEnough = False
- GameWorld.DebugLog(" 符印背包空间不足, RuneItemCount=%s > packSpace=%s" % (RuneItemCount, packSpace))
- PlayerControl.NotifyCode(curPlayer, "RuneBagFull")
-
- if isPackSpaceEnough and commPackItemCount > 0:
- itemPackSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, commPackItemCount)
- if itemPackSpace < commPackItemCount:
- isPackSpaceEnough = False
- GameWorld.DebugLog(" 背包空间不足, commPackItemCount=%s > itemPackSpace=%s" % (commPackItemCount, itemPackSpace))
- PlayerControl.NotifyCode(curPlayer, "BagFull")
+ break
#背包空间不足
if not isPackSpaceEnough:
--
Gitblit v1.8.0