1111 【英文】【越南】【BT】【砍树】修复改名成功后扣除道具时物品可能已变更导致的bug;
| | |
| | |
|
| | | return None
|
| | |
|
| | | def FindPlayerItemByType(curPlayer, packindex, itemType):
|
| | | curPack = curPlayer.GetItemManager().GetPack(packindex)
|
| | | for i in range(0, curPack.GetCount()):
|
| | | item = curPack.GetAt(i)
|
| | | |
| | | if not ItemCommon.CheckItemCanUse(item):
|
| | | continue
|
| | | |
| | | if item.GetType() == itemType:
|
| | | return item
|
| | | |
| | | return None
|
| | |
|
| | | ## 检查是否可以换马匹
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import EventReport
|
| | | import ItemControler
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | | ## 合服首登
|
| | |
| | | #扣除物品
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | curItem = itemPack.GetAt(itemIndex)
|
| | | if curItem:
|
| | | if not __CheckItemUpdatePlayerName(curPlayer, curItem):
|
| | | # 物品可能已经变更,不是改名道具了或为空,重新找一遍
|
| | | curItem = ItemControler.FindPlayerItemByType(curPlayer, IPY_GameWorld.rptItem, ChConfig.Def_ItemType_ChangePlayerName)
|
| | | if ItemCommon.CheckItemCanUse(curItem):
|
| | | ItemCommon.DelItem(curPlayer, curItem, 1, True, 'UpdatePlayerName')
|
| | |
|
| | | #改名次数+1
|