Skip to content

Commit

Permalink
tweak(lua) Use joaat instead of GetHashKey (iLLeniumStudios#133)
Browse files Browse the repository at this point in the history
* slight performance tweak

Replace gethashkey with joaat which is the native hashing algorithm used natively by gta 5 and yields slightly greater peformance with lua 5.4.

* add lua 5.4 to resource manifest
  • Loading branch information
TransitNode authored Jul 13, 2022
1 parent 9b16ffd commit 39b9de7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ local function EnsurePedModel(pedModel)
end

local function CreatePedAtCoords(pedModel, coords, scenario)
pedModel = type(pedModel) == "string" and GetHashKey(pedModel) or pedModel
pedModel = type(pedModel) == "string" and joaat(pedModel) or pedModel
EnsurePedModel(pedModel)
local ped = CreatePed(0, pedModel, coords.x, coords.y, coords.z - 0.98, coords.w, false, false)
TaskStartScenarioInPlace(ped, scenario, true)
Expand Down
1 change: 1 addition & 0 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ author 'snakewiz'
description 'A flexible player customization script for FiveM.'
repository 'https://github.com/pedr0fontoura/fivem-appearance'
version 'main'
lua54 'yes'

client_scripts {
'game/dist/index.js',
Expand Down

0 comments on commit 39b9de7

Please sign in to comment.