ParseActorCommands( Lua *, sCommands ) -> onto stack

This commit is contained in:
Glenn Maynard
2006-09-22 18:59:26 +00:00
parent 6da267ae30
commit 0ad4fcf6e2
2 changed files with 8 additions and 3 deletions
+7 -3
View File
@@ -396,7 +396,7 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor
}
}
apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
void ActorUtil::ParseActorCommands( Lua *L, const RString &sCommands )
{
RString sLuaFunction;
if( sCommands.size() > 0 && sCommands[0] == '\033' )
@@ -476,8 +476,6 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
sLuaFunction = s.str();
}
Lua *L = LUA->Get();
RString sError;
if( !LuaHelpers::RunScript( L, sLuaFunction, "", sError, 1 ) )
{
@@ -486,6 +484,12 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
}
/* The function is now on the stack. */
}
apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
{
Lua *L = LUA->Get();
ParseActorCommands( L, sCommands );
LuaReference *pRet = new LuaReference;
pRet->SetFromStack( L );
LUA->Release( L );
+1
View File
@@ -45,6 +45,7 @@ namespace ActorUtil
void Register( const RString& sClassName, CreateActorFn pfn );
Actor* Create( const RString& sClassName, const RString& sDir, const XNode* pNode, Actor *pParentActor );
void ParseActorCommands( Lua *L, const RString &sCommands );
apActorCommands ParseActorCommands( const RString &sCommands );
void SetXY( Actor& actor, const RString &sType );
void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName );