diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua b/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua index a6d4ee5e13..af80044c86 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua @@ -66,14 +66,23 @@ function this.SetBasicValues(giftGoodsList) end --屏蔽前置礼包没有达成购买限制的 + local removeList={} for _, v in pairs(GoodsTypeDef) do for key, value in pairs(giftGoodsInfoList[v]) do - if this.CheckGiftFrontIsOpen(value.goodsId)==false then - table.remove(giftGoodsInfoList[v], key) + if this.CheckGiftFrontIsOpen(value.goodsId)==false then + if removeList[v]==nil then + removeList[v]={} + end + table.insert(removeList[v],value) end end end - --this.RemoveItemInfoByType + for k, v in pairs(removeList) do + for i=1,#v do + table.removebyvalue(giftGoodsInfoList[k],v[i]) + end + end + Game.GlobalEvent:DispatchEvent(GameEvent.FindFairy.RefreshBuyOpenState) end @@ -81,12 +90,15 @@ end function this.CheckGiftFrontIsOpen(gift) local isOpen=true for k, v in ConfigPairs(rechargeOrder) do - if v.BehindCommodity==gift then + + if gift == v.BehindCommodity then + --LogError("v.id======================="..v.Id) if v.FrontCommodity>0 then local time=this.GetLeftBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity) local buyTime= this.GetGoodsBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity) --无限次 if time==-1 then + LogError("   giftid===="..gift) return true end @@ -97,6 +109,8 @@ function this.CheckGiftFrontIsOpen(gift) end end end + + return isOpen end