- Joined
- Jan 7, 2005
- Messages
- 7,550
So I was attempting to save a struct in a hashtable but JASSHelper kept scolding me for passing an integer instead of a handle. I had no clue why, but then I took a look at the script and realized that in vJASS the local struct x is actually replaced by «local integer x».
The script below explains better:
Notice it's been replaced by an integer. Perhaps if I change
Tertiary options / thoughts?
P.S. — I'm asking because I don't know how structs are actually converted to regular JASS and I'm afraid of collisions.
The script below explains better:
JASS:
static method create takes unit u returns Territory
local Territory NT=Territory.allocate()
call SaveInteger(udg_HtH,GetHandleId(NT),0,GetHandleId(u))
call SaveInteger(udg_HtH,GetHandleId(u),40,GetHandleId(NT))
call SaveReal(udg_HtH,GetHandleId(u),30,size)
return NT
endmethod
Code:
function s__Territory_create unit u returns integer
local [B][U]integer[/U][/B] NT=s__Territory__allocate()
call SaveInteger(udg_HtH, GetHandleId(NT), 0, GetHandleId(u))
call SaveInteger(udg_HtH, GetHandleId(u), 40, GetHandleId(NT))
call SaveReal(udg_HtH, GetHandleId(u), 30, size)
return NT
endfunction
GetHandleId(NT)
for simply «NT» it'll work?Tertiary options / thoughts?
P.S. — I'm asking because I don't know how structs are actually converted to regular JASS and I'm afraid of collisions.