hxp
2020-01-09 f38f1d13f83bd005eab8a101173c916d03163dc7
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
@@ -357,12 +357,15 @@
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for index in xrange(ipyDataMgr.GetHorseLVUpCount()):
        horseIpyData = ipyDataMgr.GetHorseLVUpByIndex(index)
        if horseIpyData.GetHorseLV() >= horseLV:
            totalItemCount += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount)
        dataHorseLV = horseIpyData.GetHorseLV()
        if dataHorseLV > horseLV:
            break
        elif dataHorseLV == horseLV:
            totalItemCount += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount)
        else:
            totalItemCount += horseIpyData.GetNeedEatCount()
        # 等阶额外属性
        totalItemCount += horseIpyData.GetNeedEatCount()
        lvAttrTypeList = horseIpyData.GetLVAttrType()
        lvAttrValueList = horseIpyData.GetLVAttrValue()
        for i, attrID in enumerate(lvAttrTypeList):
@@ -451,11 +454,12 @@
    
    costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
    lackCnt = costItemCount - bindCnt - unBindCnt
    if lackCnt >= 0 and not isAutoBuy:
    if lackCnt > 0 and not isAutoBuy:
        GameWorld.DebugLog("消耗道具不足,无法升级坐骑!costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" 
                           % (costItemID, costItemCount, bindCnt, unBindCnt, lackCnt))
        return
    
    delCnt = costItemCount
    if lackCnt > 0:
        lackCost = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCnt})
        if lackCost <= 0:
@@ -463,9 +467,9 @@
        infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
        if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, lackCost, ChConfig.Def_Cost_BuyStoreItem, infoDict):
            return
        delCnt -= lackCnt
        
    # 扣除消耗
    delCnt = max(0, costItemCount - lackCnt) # 实际扣除的个数
    if delCnt:
        ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delCnt, ChConfig.ItemDel_Horse)