Commit ec3ba8821921b7fa4b80b989bff047c30441ec45

Authored by liuzujun
2 parents b62c0a4c 5cf05cda

Merge branch 'cn/develop' into cn/publish/zhaolu

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
src/actions/StoreAction.lua
@@ -400,7 +400,6 @@ function _M.shopBuyRpc(agent , data) @@ -400,7 +400,6 @@ function _M.shopBuyRpc(agent , data)
400 end 400 end
401 401
402 if not role:checkItemEnough(cost) then return 4 end 402 if not role:checkItemEnough(cost) then return 4 end
403 - if not role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, long1= dataSet.shop}}) then return 5 end  
404 403
405 local buyRecord = role.storeData:getProperty("buyR") 404 local buyRecord = role.storeData:getProperty("buyR")
406 if math.illegalNum(count, 1, (dataSet.limit == 0 and 10000 or dataSet.limit - (buyRecord[id] or 0))) then 405 if math.illegalNum(count, 1, (dataSet.limit == 0 and 10000 or dataSet.limit - (buyRecord[id] or 0))) then
@@ -408,6 +407,8 @@ function _M.shopBuyRpc(agent , data) @@ -408,6 +407,8 @@ function _M.shopBuyRpc(agent , data)
408 return 6 407 return 6
409 end 408 end
410 409
  410 + if not role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, long1= dataSet.shop}}) then return 5 end
  411 +
411 local limitStr = "" 412 local limitStr = ""
412 if dataSet.limit ~= 0 then 413 if dataSet.limit ~= 0 then
413 buyRecord[id] = (buyRecord[id] or 0) + count 414 buyRecord[id] = (buyRecord[id] or 0) + count