Skip to content

bitExtract is broken (client side) #1135

@Xenius97

Description

@Xenius97

Describe the bug
bitExtract doesn't work (client side)

To reproduce

function toRGBA(color)
local b = bitExtract(color, 0, 8)
local g = bitExtract(color, 8, 8)
local r = bitExtract(color, 16, 8)
local a = bitExtract(color, 24, 8)
return r, g, b, a
end

local color = tocolor(123, 234, 196, 255)
print(toRGBA(color))

--> Always return 255
Serverside working properly

Clientside Runcode: tocolor(255, 200, 100, 255)
Result: -14236 [number]

srun bitExtract("-14236", 0, 8)
Result: 100 [number]
srun bitExtract("-14236", 8, 8)
Result: 200 [number]

Version
Multi Theft Auto v1.5.7-release-20325
Tested also on
Multi Theft Auto v1.5.7-release-20332

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions