1.23b is still in beta. As most of you know, return bug has been fixed in the version, this is a sad news for those who like to research the code exploit 
I've found a new way to typecast in 1.23b :
common.j
"type a extends b" means, a variable of type a is also type b, but var of type b is not type a.
ConvertVersion - what does this function do ? actually its just a type conversion function, it has only 2 lines:
MOV EAX, [ESP+4]
RETN
ConvertVersion(1048576) is really H2Version(I2H(1048576)).
change the definition of type to:
since type unit extends handle, everything about functions of type version will stay unaffected.
Now, you can write another function for easier use, like
see ? you have the typecasting without using return bug.
there are dozens of Convert functions, just modify the type definition, you can use them to convert from integer to any type
EDIT : i have tested under 1.23b, sadly it cant use "extends code" ...
however you can use it for I2U, I2Item, I2Timer and so on.
I've found a new way to typecast in 1.23b :
common.j
Code:
type version extends handle
constant native ConvertVersion takes integer i returns version
"type a extends b" means, a variable of type a is also type b, but var of type b is not type a.
ConvertVersion - what does this function do ? actually its just a type conversion function, it has only 2 lines:
MOV EAX, [ESP+4]
RETN
ConvertVersion(1048576) is really H2Version(I2H(1048576)).
change the definition of type to:
Code:
type version extends unit
since type unit extends handle, everything about functions of type version will stay unaffected.
Now, you can write another function for easier use, like
Code:
function I2U takes integer i returns unit
return ConvertVersion(i)
endfunction
see ? you have the typecasting without using return bug.
there are dozens of Convert functions, just modify the type definition, you can use them to convert from integer to any type
EDIT : i have tested under 1.23b, sadly it cant use "extends code" ...
however you can use it for I2U, I2Item, I2Timer and so on.
Last edited: