I suspect str is casting the object function into a dword, when it is really an int...
class glitchy
int glt[10]
method constructor()
glt[5] = -5
end method
function func(int d) as int
print "i am returning: " & str(glt[d])
return glt[d]
end function
end class
new glitchy sss()
print "but i am receiving: " & str(sss.func(5))
int f = sss.func(5)
print "no, it is correct: " & str(f)
output:
i am returning: -5
but i am receiving: 4294967291
no, it is correct: -5