:getLocalVarOffset
{
 Parameters:
   Passed:
     0@ - thread pointer
     1@ - var number
   Result:
     1@ - var value

 Example:
   0AB1: call_scm_func @getLocalVarOffset 2 thread 0@ var 0 store_to 1@ 
}
1@ *= 4
1@ += 60
005A: 0@ += 1@  // (int)
0AB2: ret 1 0@
{
if 
 0@ <> 0 
then
 1@ *= 0x4 
 0A8E: 2@ = 0@ + 0xDC // mission flag
 0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
 if 
   2@ == 1 
 then
   1@ += 0xA48960 // mission locals
 else
   005A: 1@ += 0@ 
   1@ += 0x3C 
 end
else
 1@ = 0 
end
0AB2: ret 1 1@
}