Native: DUI Handle not working with lua 5.4 and fxv2_oal

  1. Client running beta, Server running FxServer-linux 5171
  2. I expected a Dui Handle which could be passed into other natives
  3. As soon as the Dui Handle is passed into another native (ie. GetDuiHandle) the native crashes
  4. Native related issue
  5. Code to replicate issue:

In fxmanifest don’t forget to set:

use_fxv2_oal "true"
lua54 "yes"
RegisterCommand("test_dui", function()
    --"https://i.imgur.com/JOwVc6g.gif"

    local runtimeTxd = CreateRuntimeTxd('Custom_Menu_Head')
    local duiObject = CreateDui("https://i.imgur.com/JOwVc6g.gif", 512, 128)
    print(duiObject)
    local timeout = 0
    while not IsDuiAvailable(duiObject) and timeout < 5000 do
        Citizen.Wait(100)
        timeout = timeout + 100
    end

    local duiHandle = GetDuiHandle(duiObject)
    local Texture = CreateRuntimeTextureFromDuiHandle(runtimeTxd, 'Custom_Menu_Head', duiHandle)

    DestroyDui(duiObject)
end)

Using the combination of lua 5.4 and fxv2_oal appears to not be working with long type numbers. So probably something to do with the way lua 5.4 handles integers (specifically longs) compared to lua 5.1.
Either getting rid of lua 5.4 of fxv2_oal fixes the issue.

… 5.1?

OAL flag only works with lua54 set as well, so that’s somewhat obvious.

Please test: fivem/codegen_out_native_lua.lua at master · citizenfx/fivem · GitHub

		if type.subType == 'long' then
			argType = template:format("int64_t", retval)
		else
			argType = template:format("int32_t", retval)
		end