mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Testing a fix with QS-INV item checks
So..from what I can gather, QS-Inv doesn't seem to be updating the client cache of the players inventory correctly This is all speculation, I can't check this myself When `hasItem()` is used, its essentially reading from the client's cache. This seemingly is only updated when there is a new item in a slot, **not** when the amount of an item in that slot changes The only way to circumvent this is a workaround to the players inventory from the server side using a callback. This is painful to do because it can increase server load when checking multiples of items
This commit is contained in:
@@ -99,7 +99,8 @@ function getPlayerInv(src)
|
||||
if src then
|
||||
grabInv = exports[QSInv]:GetInventory(src)
|
||||
else
|
||||
grabInv = exports[QSInv]:getUserInventory()
|
||||
--grabInv = exports[QSInv]:getUserInventory()
|
||||
grabInv = triggerCallback(getScript().."getServerInvData", GetPlayerServerId(PlayerId()))
|
||||
end
|
||||
|
||||
elseif isStarted(OrigenInv) then
|
||||
@@ -171,6 +172,10 @@ function getPlayerInv(src)
|
||||
return grabInv, foundInv
|
||||
end
|
||||
|
||||
createCallback(getScript()..":getServerInvData", function(source)
|
||||
local src = source
|
||||
return getPlayerInv(src)
|
||||
end)
|
||||
|
||||
function isInventoryOpen()
|
||||
if isStarted(OXInv) then
|
||||
|
||||
Reference in New Issue
Block a user