So I register that, as well as AddRef and Release behaviour. Then I call the script like this
[/source]
//CPP Side
void GamePlayer::attack(){ PrepareScriptFunction( "PlayerModule", "void attack(GamePlayer @player)"); AngelContext->SetArgObject( 0, this ); ExecuteScriptFunction();}
Also, since I didn't want to let the script handle the memory management for GamePlayer, I didn't put the " if( refcount == 0) delete this; " in the Release method. And at the end of the script function void attack, I set the argument to point to null. Would this be ok or the script will still hold a reference of the GamePlayer?