From 30f12b27907da3ba5206127503a2abe404a62c28 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Tue, 2 Mar 2021 11:23:10 +0800 Subject: [PATCH] 战令活动过期清购买记录, 升级月卡只能同等级续费 --- src/models/Activity.lua | 9 +++++++++ src/models/Store.lua | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 2c670bd..7743f76 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -1082,6 +1082,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = { actData["week"] = 0 self:updateActData(actType, actData, true) end, + ["close"] = function (self, actType, notify, actId) + local rechargeRecord = self.owner.storeData:getProperty("payR") + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then + rechargeRecord[id] = nil + end + end + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord}) + end, } diff --git a/src/models/Store.lua b/src/models/Store.lua index 45ef3a3..f8c5fd8 100644 --- a/src/models/Store.lua +++ b/src/models/Store.lua @@ -219,7 +219,8 @@ function Store:onBuyCard(type, duration, id, actid) else local cfg = csvdb["shop_cardCsv"][id] if not cfg then return end - if cfg.level - self:getCurMonthCardLvl() ~= 1 then + local dif = cfg.level - self:getCurMonthCardLvl(false) + if dif > 1 and dif < 0 then return end self:updateProperty({field = "monthCardId", value = id}) @@ -240,7 +241,8 @@ function Store:onBuyCard(type, duration, id, actid) else local cfg = csvdb["shop_cardCsv"][id] if not cfg then return end - if cfg.level - self:getCurMonthCardLvl() ~= 1 then + local dif = cfg.level - self:getCurMonthCardLvl(true) + if dif > 1 and dif < 0 then return end self:updateProperty({field = "smonthCardId", value = id}) -- libgit2 0.21.2