allocate later

don't set name for binary chunks
This commit is contained in:
Glenn Maynard
2006-09-22 04:56:35 +00:00
parent 4a9b1736f5
commit f8c1675309
+3 -3
View File
@@ -478,8 +478,6 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
Lua *L = LUA->Get();
LuaReference *pRet = new LuaReference;
RString sError;
if( !LuaHelpers::RunScript( L, sLuaFunction, "", sError, 1 ) )
{
@@ -487,12 +485,14 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
}
/* The function is now on the stack. */
LuaReference *pRet = new LuaReference;
pRet->SetFromStack( L );
LUA->Release( L );
ASSERT_M( !pRet->IsNil(), sLuaFunction.c_str() );
pRet->SetName( sLuaFunction );
if( sCommands.size() > 0 && sCommands[0] != '\033' ) // not a binary chunk
pRet->SetName( sLuaFunction );
return apActorCommands( pRet );
}