Commit b0a6cf59919a846de6be70667bdd9fdfbebacf2d
1 parent
9fa9ebd9
fix: 购买战令后,奖励没发放的bug
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/models/Store.lua
@@ -474,7 +474,7 @@ function Store:onBuyCard(type, duration, id, actid) | @@ -474,7 +474,7 @@ function Store:onBuyCard(type, duration, id, actid) | ||
474 | self:updateProperty({field = "bpInfo", value = bpInfo}) | 474 | self:updateProperty({field = "bpInfo", value = bpInfo}) |
475 | elseif type == CardType.ActBattleCommandCard then | 475 | elseif type == CardType.ActBattleCommandCard then |
476 | if not self.owner.activity:isOpenById(actid, "ActShopGoods") then | 476 | if not self.owner.activity:isOpenById(actid, "ActShopGoods") then |
477 | - return | 477 | + return nil |
478 | end | 478 | end |
479 | local actCfg = csvdb["activity_ctrlCsv"][actid] | 479 | local actCfg = csvdb["activity_ctrlCsv"][actid] |
480 | if not actCfg then return end | 480 | if not actCfg then return end |
@@ -486,6 +486,10 @@ function Store:onBuyCard(type, duration, id, actid) | @@ -486,6 +486,10 @@ function Store:onBuyCard(type, duration, id, actid) | ||
486 | end | 486 | end |
487 | self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0}) | 487 | self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0}) |
488 | self.owner.activity:updateActData("BattleCommand", actData) | 488 | self.owner.activity:updateActData("BattleCommand", actData) |
489 | + local rechargeData = csvdb["shop_rechargeCsv"][id] | ||
490 | + if rechargeData then | ||
491 | + return self.owner:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | ||
492 | + end | ||
489 | end | 493 | end |
490 | return nil, nil | 494 | return nil, nil |
491 | end | 495 | end |