Jump to content

  • Log In with Google      Sign In   
  • Create Account


yamashi-

Member Since 17 Oct 2011
Offline Last Active Feb 25 2013 05:05 PM

Posts I've Made

In Topic: Passing reference as parameter

11 February 2013 - 01:03 PM

The thing being I don't have ref counting on these objects (my application manages everything).

 

And no no negative value what's so ever :s

 

My bad, my variadic template call was actually doing a hard copy of the object and passing a stack address that had been deleted.

 

Here is my code if someone wants an easy way to start : https://github.com/yamashi/SkyrimOnline/blob/master/Client/Src/Server/Src/Game/ScriptEngine.hpp


In Topic: Passing reference as parameter

11 February 2013 - 05:23 AM

Here it is :

 

NPC npc;
context->Prepare(func);
context->SetArgObject(0, &npc);
context->Execute();
context->Unprepare();

 

And the AS code :

 

void OnNew(NPC @npc)
{
print(npc.GetName());
}

 

 Note that it does work if I set mt NPC to a global parameter so there is nothing wrong with my GetName() :(


PARTNERS