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:
Jim Shield
2025-05-13 17:57:27 +01:00
parent 04b25e2c06
commit e64912622b

View File

@@ -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