Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit c4e73dd

Browse files
committed
fix(client): revert some micro-optimisations
Seems to break the cache ref; inventory is essentially broken on login.
1 parent 1243351 commit c4e73dd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

client.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,14 +869,18 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
869869

870870
local Licenses = data 'licenses'
871871

872-
client.interval = SetInterval(function(playerPed, vehicle)
872+
client.interval = SetInterval(function()
873+
local playerPed = cache.ped
874+
873875
if invOpen == false then
874876
playerCoords = GetEntityCoords(playerPed)
875877

876878
if closestMarker[1] then
877879
table.wipe(closestMarker)
878880
end
879881

882+
local vehicle = cache.vehicle
883+
880884
markers(drops, 'drop', vec3(150, 30, 30), nil, vehicle)
881885

882886
if not shared.qtarget then
@@ -929,10 +933,11 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
929933
Utils.DeleteObject(client.parachute)
930934
client.parachute = false
931935
end
932-
end, 200, cache.ped, cache.vehicle)
936+
end, 200)
933937

934938
local EnableKeys = client.enablekeys
935-
client.tick = SetInterval(function(playerId, disableControls)
939+
client.tick = SetInterval(function(disableControls)
940+
local playerId = cache.playerId
936941
DisablePlayerVehicleRewards(playerId)
937942

938943
if invOpen then
@@ -1038,7 +1043,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
10381043
end
10391044
end
10401045
end
1041-
end, 0, cache.playerId, lib.disableControls)
1046+
end, 0, lib.disableControls)
10421047

10431048
collectgarbage('collect')
10441049
end)

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ game 'gta5'
77
--[[ Resource Information ]]--
88
name 'ox_inventory'
99
author 'Overextended'
10-
version '2.5.4'
10+
version '2.5.5'
1111
repository 'https://github.com/overextended/ox_inventory'
1212
description 'Slot-based inventory with metadata'
1313

0 commit comments

Comments
 (0)