From 9f207942b67150a264e3dfe5ae01f466a2dec0e5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 15 Oct 2006 01:43:13 +0000 Subject: [PATCH] use LuaHelpers::DeepCopy --- stepmania/src/LuaReference.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/stepmania/src/LuaReference.cpp b/stepmania/src/LuaReference.cpp index 305a190f87..9d85d6e077 100644 --- a/stepmania/src/LuaReference.cpp +++ b/stepmania/src/LuaReference.cpp @@ -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 ); }