少年修仙传客户端代码仓库
Client_PangDeRong
2018-09-26 b7ec6b76304bd514127aa92fc75ba62489629442
1834  分解装备时恰好自动出售物品,分解了错误的装备
2个文件已修改
65 ■■■■ 已修改文件
System/KnapSack/Logic/PlayerPackModels.cs 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SystemSetting/SettingEffectMgr.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/PlayerPackModels.cs
@@ -1230,10 +1230,9 @@
            return 0;
        }
        public List<ItemModel> canDevourModellist = new List<ItemModel>();
        public List<ItemModel> GetCanDevourModellist()
        {
            canDevourModellist.Clear();
            List<ItemModel> canDevourModellist = new List<ItemModel>();
            SinglePackModel singlePack = GetSinglePackModel(PackType.rptItem);
            if (singlePack == null
                || colorType == EquipColorType.None
@@ -1309,9 +1308,12 @@
        public List<ItemModel> selectDevourlist = new List<ItemModel>();
        public void GetSelectDevourList()
        {
            GetCanDevourModellist();
            selectDevourlist.Clear();
            selectDevourlist.AddRange(canDevourModellist);
            List<ItemModel> itemModels = GetCanDevourModellist();
            if (itemModels != null)
            {
                selectDevourlist.AddRange(itemModels);
            }
        }
        public void RefreshGetNewItem(ItemModel model)
@@ -1380,17 +1382,33 @@
            return null;
        }
        public bool IsReachMinDecomposeNum()
        {
            List<ItemModel> itemModels = GetCanDevourModellist();
            if(itemModels != null && itemModels.Count >= minDecomposeNum)
            {
                return true;
            }
            return false;
        }
        public void SendEquipdevourQuest()
        {
            if (canDevourModellist.Count < minDecomposeNum) return;
            List<ItemModel> itemModels = GetCanDevourModellist();
            if (itemModels == null || itemModels.Count < minDecomposeNum) return;
            isAutoDecompose = true;
            recordAutoDecomNum = canDevourModellist.Count;
            recordAutoDecomNum = itemModels.Count;
            CA32C_tagCMEquipDecompose _petEat = new CA32C_tagCMEquipDecompose();
            byte[] _petIndex = new byte[canDevourModellist.Count];
            for (int i = 0; i < canDevourModellist.Count; i++)
            byte[] _petIndex = new byte[recordAutoDecomNum];
            for (int i = 0; i < recordAutoDecomNum; i++)
            {
                _petIndex[i] = (byte)canDevourModellist[i].itemInfo.ItemPlace;
                _petIndex[i] = (byte)itemModels[i].itemInfo.ItemPlace;
                if (itemModels[i].chinItemModel.StarLevel >= 2
                    || (itemModels[i].chinItemModel.EquipPlace == 0 && itemModels[i].chinItemModel.Type != 29))
                {
                    return;
                }
            }
            _petEat.IndexCount = (byte)_petIndex.Length;
            _petEat.IndexList = _petIndex;
System/SystemSetting/SettingEffectMgr.cs
@@ -60,13 +60,11 @@
        delayTime = 2;
        HeroBehaviour.OnStartHandupAI -= OnStartHandupAI;
        HeroBehaviour.OnStopHandupAI -= OnStopHandupAI;
        playerPack.ItemCntAddAct -= RefreshItemCnt;
        DeadModel.playerDieEvent -= OnPlayerDie;
        m_storeModel.RefreshBuyResultEvent -= RefreshBuySuccess;
        DeadModel.CloseRebornWinEvent -= PlayerRebornSuccess;
        HeroBehaviour.OnStartHandupAI += OnStartHandupAI;
        HeroBehaviour.OnStopHandupAI += OnStopHandupAI;
        playerPack.ItemCntAddAct += RefreshItemCnt;
        DeadModel.playerDieEvent += OnPlayerDie;
        m_storeModel.RefreshBuyResultEvent += RefreshBuySuccess;
        DeadModel.CloseRebornWinEvent += PlayerRebornSuccess;
@@ -102,19 +100,10 @@
            }
        }
     
        if (secondTimer > 1f)
        if (secondTimer >= 1f)
        {
            if(isGetNewItem)
            {
                secondTimer = 0f;
                delayTime -= 1;
                if (delayTime <= 0)
                {
                    isGetNewItem = false;
                    delayTime = 2f;
                    DealBagItem();
                }
            }
            secondTimer = 0f;
            RefreshBagItem();
        }
    }
@@ -153,11 +142,6 @@
        }
    }
    private void RefreshItemCnt(PackType type, int index, int id)
    {
        RefreshBagItem();
    }
    public void RefreshBagItem()
    {
        if (!_isAutoHangUp)
@@ -165,9 +149,7 @@
            DebugEx.Log("请开启自动挂机,否则无法出售");
            return;
        }
        DealBagItem();
        isGetNewItem = true;
    }
    /// <summary>
@@ -175,12 +157,11 @@
    /// </summary>
    private void DealBagItem()
    {
        if (playerPack.GetReaminGridCount(PackType.rptItem) < 5)
        if (playerPack.GetReaminGridCount(PackType.rptItem) < 5 && modelInterface.isPackResetOk)
        {
            if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.isAutoDevour))
            {
                List<ItemModel> list = playerPack.GetCanDevourModellist();
                if (list !=  null &&  list.Count > 0)
                if(playerPack.IsReachMinDecomposeNum())
                {
                    playerPack.SendEquipdevourQuest();
                    return;