Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cache): Set ped cache after SetPlayerPed #292

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/framework/esx/compatibility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RegisterNetEvent("skinchanger:loadSkin", function(skin, cb)
else -- add validation invisible when failed registration (maybe server restarted when apply skin)
SetInitialClothes(Config.InitialPlayerClothes[Framework.GetGender(true)])
end
TriggerEvent('esx:restoreLoadout')
TriggerEvent("esx:restoreLoadout")
Framework.CachePed()
if cb ~= nil then
cb()
Expand Down
1 change: 1 addition & 0 deletions client/framework/qb/migrate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RegisterNetEvent("illenium-appearance:client:migration:load-qb-clothing-skin", f
Citizen.CreateThread(function()
lib.requestModel(model, 1000)
SetPlayerModel(cache.playerId, model)
cache:set("ped", PlayerPedId())
SetPedComponentVariation(cache.ped, 0, 0, 0, 2)
TriggerEvent("illenium-appearance:client:migration:load-qb-clothing-clothes", playerSkin, cache.ped)
SetModelAsNoLongerNeeded(model)
Expand Down
1 change: 1 addition & 0 deletions game/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ local function setPlayerModel(model)
while not HasModelLoaded(model) do Wait(0) end

SetPlayerModel(cache.playerId, model)
cache:set("ped", PlayerPedId())
SetModelAsNoLongerNeeded(model)

if isPedFreemodeModel(cache.ped) then
Expand Down