From 5d8cb4bfff6b09b16a01a842fd95dd0007a13d28 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 25 Jul 2023 22:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E7=A4=BC=E5=8C=85=E9=87=8D?= =?UTF-8?q?=E7=99=BB=E4=B8=8D=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/dungeon/dungeon_armor_entity.lua | 6 +++--- lua/app/userdata/dungeon/dungeon_weapon_entity.lua | 6 +++--- lua/app/userdata/shop/shop_data.lua | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) 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)