sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
44 stars 0 forks source link

Variable declaration and assigment in one line not working #308

Closed MiranDMC closed 3 months ago

MiranDMC commented 3 months ago

This code will compile and work as expected:

int data
data = read_memory 0x... {size} 4 {vp} true

Line below will compile, but arguments order is invalid.

int data = read_memory 0x... {size} 4 {vp} true

read_memory will throw error about accessing address 0 (seems like data becomes first argument).

x87 commented 3 months ago

can you attach a compiled .cs file?

what edit mode are you using?

MiranDMC commented 3 months ago

what edit mode are you using?

GTA SA 1.0 SBL

MiranDMC commented 3 months ago

Hm seems be more complicated scenario. In simple test case it works... I need to investigate further.

{$CLEO .cs}
nop

define function FOO()

wait 0
FOO()

terminate_this_custom_script

function FOO()
    int addr = read_memory 0x00447097 {size} 4 {vp} true
    print_formatted_now {fmt} "ADDRESS %X" {time} 20000 {arg} addr
    cleo_return
end
MiranDMC commented 3 months ago

I was not able to reproduce the problem in small test scripts. Seems like caused by other mistakes during project conversion to SBL mode.