use LuaHelpers::DeepCopy

This commit is contained in:
Glenn Maynard
2006-10-15 01:43:13 +00:00
parent 10b96b08b8
commit 9f207942b6
+6 -7
View File
@@ -70,21 +70,20 @@ void LuaReference::SetFromNil()
void LuaReference::DeepCopy()
{
/* Call DeepCopy(t), where t is our referenced object. */
/* Call DeepCopy(t, u), where t is our referenced object and u is the new table. */
Lua *L = LUA->Get();
lua_pushstring( L, "DeepCopy" );
lua_gettable( L, LUA_GLOBALSINDEX );
ASSERT_M( !lua_isnil(L, -1), "DeepCopy() missing" );
ASSERT_M( lua_isfunction(L, -1), "DeepCopy() not a function" );
/* Arg 1 (t): */
this->PushSelf( L );
lua_call( L, 1, 1 );
/* Arg 2 (u): */
lua_newtable( L );
lua_pushvalue( L, -1 );
this->SetFromStack( L );
LuaHelpers::DeepCopy( L );
LUA->Release( L );
}