diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua b/lua/app/userdata/dungeon/dungeon_armor_entity.lua index a7e581e5..63c8db24 100644 --- a/lua/app/userdata/dungeon/dungeon_armor_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua @@ -19,7 +19,7 @@ function DungeonArmorEntity:init(data) self.fundRewards = data.fund_rewards self.totalChallengeCount = data.total_challenge_count - self:updateGift(data.gift_info) + self:updateGift(data.gift_info, true) DataManager.FormationData:initDungeonArmor(self.heroes) DataManager:registerCrossDayFunc("DungeonArmorEntity", function() @@ -52,8 +52,8 @@ function DungeonArmorEntity:refreshFarmCount(chapterId, count) end -- 更新礼包状态 -function DungeonArmorEntity:updateGift(giftInfo) - DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT, giftInfo) +function DungeonArmorEntity:updateGift(giftInfo, isInit) + DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT, giftInfo, isInit) end function DungeonArmorEntity:setStarReward(starId) diff --git a/lua/app/userdata/dungeon/dungeon_weapon_entity.lua b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua index 26214269..4f6c42d7 100644 --- a/lua/app/userdata/dungeon/dungeon_weapon_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua @@ -15,7 +15,7 @@ function DungeonWeaponEntity:init(data) self.totalChallengeCount = data.total_challenge_count or {} self.data.isDirty = not self.data.isDirty - self:updateGift(data.gift_info) + self:updateGift(data.gift_info, true) DataManager.FormationData:initDungeonWeapon(self.heroes) DataManager:registerCrossDayFunc("DungeonWeaponEntity", function() @@ -38,8 +38,8 @@ function DungeonWeaponEntity:refreshInfoOnFarm(result) end -- 更新礼包状态 -function DungeonWeaponEntity:updateGift(giftInfo) - DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT, giftInfo) +function DungeonWeaponEntity:updateGift(giftInfo, isInit) + DataManager.ShopData:initGift(PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT, giftInfo, isInit) end function DungeonWeaponEntity:setDirty() diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua index e55e6fce..f58bc69e 100644 --- a/lua/app/userdata/shop/shop_data.lua +++ b/lua/app/userdata/shop/shop_data.lua @@ -823,7 +823,7 @@ end -- 武器礼包 -------------------------------------------------------------------------------------------- -- 初始化礼包(礼包类型1下的礼包,可以直接复用这里的方法) -function ShopData:initGift(giftType, gift) +function ShopData:initGift(giftType, gift, isInit) if giftType == nil or gift == nil then return end @@ -846,7 +846,7 @@ function ShopData:initGift(giftType, gift) local tempId = self.gifts[giftType] and self.gifts[giftType].id or 0 self.gifts[giftType] = giftStruct - if self:hasGift(giftType) then + if not isInit and self:hasGift(giftType) then if tempId == self.gifts[giftType].id then if EDITOR_MODE then Logger.logHighlight("重复礼包数据,不处理弹窗:" .. tempId)