Skip to content

spread operator should reverse variables when used with a foreign function #386

@x87

Description

@x87
function RegOne<cdecl, 0x724B60>(tl: float[3], bl: float[3], tr: float[3], br: float[3], uv1: float[2], uv2: float[2], uv3: float[2], uv4: float[2], one: int, rgb: int[3], distance: float)

float tl[3]
float bl[3]
float tr[3]
float br[3]
float uv1[2]
float uv2[2]
float uv3[2]
float uv4[2]

int rgb[3]

RegOne(...tl, ...bl, ...tr, ...br, ...uv1, ...uv2, ...uv3, ...uv4, 1, ...rgb, 50.0) // doesnt work
RegOne(tl[0], tl[1], tl[2], bl[0], bl[1], bl[2], tr[0], tr[1], tr[2], br[0], br[1], br[2], uv1[0], uv1[1], uv2[0], uv2[1], uv3[0], uv3[1], uv4[0], uv4[1], 1, rgb[0], rgb[1], rgb[2], 50.0) // works

terminate_this_custom_script

results in

0000: nop 
0AA5: call_function {address} 7490400 {numArgs} 25 {pop} 25 {args} 50.0 20@ 21@ 22@ 1 18@ 19@ 16@ 17@ 14@ 15@ 12@ 13@ 9@ 10@ 11@ 6@ 7@ 8@ 3@ 4@ 5@ 0@ 1@ 2@ // spread
0AA5: call_function {address} 7490400 {numArgs} 25 {pop} 25 {args} 50.0 22@ 21@ 20@ 1 19@ 18@ 17@ 16@ 15@ 14@ 13@ 12@ 11@ 10@ 9@ 8@ 7@ 6@ 5@ 4@ 3@ 2@ 1@ 0@ // no spread
0A93: terminate_this_custom_script 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions