Commit ff72d1ebb30b4d689bebe4c4bbac6be1a6ef33b5

Authored by zhangqijia
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 290 return 1
291 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 296 local desc = "unknowShop"
296 297 if dataSet.shop == 1 then -- 普通商店
297 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 299 elseif dataSet.shop == 2 then -- 美食商店
303 300 desc = "dinerShop"
304 301 elseif dataSet.shop == 3 then -- 竞技场商店
... ... @@ -313,7 +310,7 @@ function _M.shopBuyRpc(agent , data)
313 310 role.storeData:updateProperty({field = "buyR", value = buyRecord})
314 311 limitStr = string.format("%s/%s", buyRecord[id], dataSet.limit)
315 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 315 local gift = {}
319 316 for _id, _count in pairs(dataSet.gift:toNumMap()) do
... ...