From b0a6cf59919a846de6be70667bdd9fdfbebacf2d Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Mon, 9 Aug 2021 18:43:11 +0800 Subject: [PATCH] fix: 购买战令后,奖励没发放的bug --- src/models/Store.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/Store.lua b/src/models/Store.lua index 005bd22..2834e0a 100644 --- a/src/models/Store.lua +++ b/src/models/Store.lua @@ -474,7 +474,7 @@ function Store:onBuyCard(type, duration, id, actid) self:updateProperty({field = "bpInfo", value = bpInfo}) elseif type == CardType.ActBattleCommandCard then if not self.owner.activity:isOpenById(actid, "ActShopGoods") then - return + return nil end local actCfg = csvdb["activity_ctrlCsv"][actid] if not actCfg then return end @@ -486,6 +486,10 @@ function Store:onBuyCard(type, duration, id, actid) end self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0}) self.owner.activity:updateActData("BattleCommand", actData) + local rechargeData = csvdb["shop_rechargeCsv"][id] + if rechargeData then + return self.owner:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) + end end return nil, nil end -- libgit2 0.21.2