diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index da3b4e0..03da4f6 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -399,7 +399,6 @@ function _M.shopBuyRpc(agent , data) end if not role:checkItemEnough(cost) then return 4 end - if not role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, long1= dataSet.shop}}) then return 5 end local buyRecord = role.storeData:getProperty("buyR") 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) return 6 end + if not role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, long1= dataSet.shop}}) then return 5 end + local limitStr = "" if dataSet.limit ~= 0 then buyRecord[id] = (buyRecord[id] or 0) + count -- libgit2 0.21.2