Commit ff72d1ebb30b4d689bebe4c4bbac6be1a6ef33b5
1 parent
41b05e8f
fix: 商店商品购买折扣bug
Showing
1 changed file
with
3 additions
and
6 deletions
Show diff stats
src/actions/StoreAction.lua
@@ -290,15 +290,12 @@ function _M.shopBuyRpc(agent , data) | @@ -290,15 +290,12 @@ function _M.shopBuyRpc(agent , data) | ||
290 | return 1 | 290 | return 1 |
291 | end | 291 | end |
292 | 292 | ||
293 | - local cost = {[dataSet.icon] = dataSet.cost * count} | 293 | + local cost = {[dataSet.icon] = dataSet.cost * count * ((dataSet.disount or 10) / 10)} |
294 | + | ||
294 | 295 | ||
295 | local desc = "unknowShop" | 296 | local desc = "unknowShop" |
296 | if dataSet.shop == 1 then -- 普通商店 | 297 | if dataSet.shop == 1 then -- 普通商店 |
297 | desc = "dailyShop" | 298 | desc = "dailyShop" |
298 | - local dailySDD = role.dailyData:getProperty("dailySDD") | ||
299 | - if dailySDD[id] then -- 折扣 | ||
300 | - cost = math.ceil(dataSet.cost * (1 - dataSet.disount / 100)) | ||
301 | - end | ||
302 | elseif dataSet.shop == 2 then -- 美食商店 | 299 | elseif dataSet.shop == 2 then -- 美食商店 |
303 | desc = "dinerShop" | 300 | desc = "dinerShop" |
304 | elseif dataSet.shop == 3 then -- 竞技场商店 | 301 | elseif dataSet.shop == 3 then -- 竞技场商店 |
@@ -313,7 +310,7 @@ function _M.shopBuyRpc(agent , data) | @@ -313,7 +310,7 @@ function _M.shopBuyRpc(agent , data) | ||
313 | role.storeData:updateProperty({field = "buyR", value = buyRecord}) | 310 | role.storeData:updateProperty({field = "buyR", value = buyRecord}) |
314 | limitStr = string.format("%s/%s", buyRecord[id], dataSet.limit) | 311 | limitStr = string.format("%s/%s", buyRecord[id], dataSet.limit) |
315 | end | 312 | end |
316 | - role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, short1 = dataSet.shop}}) | 313 | + role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, cint1= dataSet.shop}}) |
317 | 314 | ||
318 | local gift = {} | 315 | local gift = {} |
319 | for _id, _count in pairs(dataSet.gift:toNumMap()) do | 316 | for _id, _count in pairs(dataSet.gift:toNumMap()) do |