Is it GetNode() or SetNode()?
Sorry, need go sleep!
Create example:
struct TestLink
{
TestLink(){ val = 123; }
int val;
};
TestLink *GetTestLink()
{
return new TestLink();
}
r=en->RegisterObjectType( "TestLink", 0, asOBJ_REF | asOBJ_NOCOUNT ); assert( r >= 0 );
r=en->RegisterObjectProperty( "TestLink", "int val", asOFFSET( TestLink, val ) ); assert( r >= 0 );
r=en->RegisterGlobalFunction("TestLink &GetTestLink()", asFUNCTION(GetTestLink), asCALL_CDECL); assert( r >= 0 );Script:
void PrintLink_1( TestLink @ t )
{
print( "1 TestLink.val: " + t.val +"\n" );
}
void PrintLink_2( TestLink @&in t )
{
print( "2 TestLink.val: " + t.val +"\n" );
PrintLink_3( t );
}
void PrintLink_3( TestLink @& t )
{
print( "3 TestLink.val: " + t.val +"\n" );
}
void PrintLink_4( TestLink @& t )
{
print( "4 TestLink.val: " + t.val +"\n" );
}
void startGame( string ¶m )
{
PrintLink_1( GetTestLink() );
PrintLink_2( GetTestLink() );
PrintLink_4( GetTestLink() );
}
1 TestLink.val: 123
2 TestLink.val: 123
3 TestLink.val: 123
PrintLink_4 - crash program
as_context.cpp[ 2522 ]
case asBC_RDR4: *(asDWORD*)(l_fp - asBC_SWORDARG0(l_bc)) = **(asDWORD**)®s.valueRegister; l_bc++; break;