Commit 30f12b27907da3ba5206127503a2abe404a62c28
1 parent
2e283f60
战令活动过期清购买记录, 升级月卡只能同等级续费
Showing
2 changed files
with
13 additions
and
2 deletions
Show diff stats
src/models/Activity.lua
... | ... | @@ -1082,6 +1082,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = { |
1082 | 1082 | actData["week"] = 0 |
1083 | 1083 | self:updateActData(actType, actData, true) |
1084 | 1084 | end, |
1085 | + ["close"] = function (self, actType, notify, actId) | |
1086 | + local rechargeRecord = self.owner.storeData:getProperty("payR") | |
1087 | + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do | |
1088 | + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then | |
1089 | + rechargeRecord[id] = nil | |
1090 | + end | |
1091 | + end | |
1092 | + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord}) | |
1093 | + end, | |
1085 | 1094 | } |
1086 | 1095 | |
1087 | 1096 | ... | ... |
src/models/Store.lua
... | ... | @@ -219,7 +219,8 @@ function Store:onBuyCard(type, duration, id, actid) |
219 | 219 | else |
220 | 220 | local cfg = csvdb["shop_cardCsv"][id] |
221 | 221 | if not cfg then return end |
222 | - if cfg.level - self:getCurMonthCardLvl() ~= 1 then | |
222 | + local dif = cfg.level - self:getCurMonthCardLvl(false) | |
223 | + if dif > 1 and dif < 0 then | |
223 | 224 | return |
224 | 225 | end |
225 | 226 | self:updateProperty({field = "monthCardId", value = id}) |
... | ... | @@ -240,7 +241,8 @@ function Store:onBuyCard(type, duration, id, actid) |
240 | 241 | else |
241 | 242 | local cfg = csvdb["shop_cardCsv"][id] |
242 | 243 | if not cfg then return end |
243 | - if cfg.level - self:getCurMonthCardLvl() ~= 1 then | |
244 | + local dif = cfg.level - self:getCurMonthCardLvl(true) | |
245 | + if dif > 1 and dif < 0 then | |
244 | 246 | return |
245 | 247 | end |
246 | 248 | self:updateProperty({field = "smonthCardId", value = id}) | ... | ... |