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