From 34c8cf27287cb2c5f8525e29635d5e5fad3460f0 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Thu, 22 Jul 2021 14:38:24 +0800 Subject: [PATCH] fix: 商店不打折商品,售价为0的bu --- src/actions/StoreAction.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index 102ae73..8c91abc 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -290,8 +290,12 @@ function _M.shopBuyRpc(agent , data) return 1 end - if dataSet.disount == 0 then dataSet.disount = 10 end - local cost = {[dataSet.icon] = math.ceil(dataSet.cost * count * ((dataSet.disount or 10) / 10))} + local cost + if dataSet.disount == 0 then + cost = {[dataSet.icon] = math.ceil(dataSet.cost * count)} + else + cost = {[dataSet.icon] = math.ceil(dataSet.cost * count * ((dataSet.disount or 10) / 10))} + end local desc = "unknowShop" -- libgit2 0.21.2