mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Re-add old qb-inv support for canCarry()
When updating to use the new export for qb-inv, I accidently removed the old functions, this readds them and fixes support for it
This commit is contained in:
@@ -626,9 +626,26 @@ function canCarry(itemTable, src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
elseif isStarted(QBInv) then
|
elseif isStarted(QBInv) then
|
||||||
|
if QBInvNew then
|
||||||
for k, v in pairs(itemTable) do
|
for k, v in pairs(itemTable) do
|
||||||
resultTable[k] = exports[QBInv]:CanAddItem(src, k, v)
|
resultTable[k] = exports[QBInv]:CanAddItem(src, k, v)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local items = getPlayerInv(src)
|
||||||
|
local totalWeight = 0
|
||||||
|
if not items then return false end
|
||||||
|
for _, item in pairs(items) do
|
||||||
|
totalWeight += (item.weight * item.amount)
|
||||||
|
end
|
||||||
|
for k, v in pairs(itemTable) do
|
||||||
|
local itemInfo = Items[k]
|
||||||
|
if not itemInfo and not Player.Offline then
|
||||||
|
resultTable[k] = true
|
||||||
|
else
|
||||||
|
resultTable[k] = (totalWeight + (itemInfo.weight * v)) <= InventoryWeight
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
elseif isStarted(PSInv) then
|
elseif isStarted(PSInv) then
|
||||||
local items = getPlayerInv(src)
|
local items = getPlayerInv(src)
|
||||||
|
|||||||
Reference in New Issue
Block a user