ParseActorCommands( Lua *, sCommands ) -> onto stack
This commit is contained in:
@@ -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;
|
RString sLuaFunction;
|
||||||
if( sCommands.size() > 0 && sCommands[0] == '\033' )
|
if( sCommands.size() > 0 && sCommands[0] == '\033' )
|
||||||
@@ -476,8 +476,6 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
|
|||||||
sLuaFunction = s.str();
|
sLuaFunction = s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
Lua *L = LUA->Get();
|
|
||||||
|
|
||||||
RString sError;
|
RString sError;
|
||||||
if( !LuaHelpers::RunScript( L, sLuaFunction, "", sError, 1 ) )
|
if( !LuaHelpers::RunScript( L, sLuaFunction, "", sError, 1 ) )
|
||||||
{
|
{
|
||||||
@@ -486,6 +484,12 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The function is now on the stack. */
|
/* The function is now on the stack. */
|
||||||
|
}
|
||||||
|
|
||||||
|
apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
|
||||||
|
{
|
||||||
|
Lua *L = LUA->Get();
|
||||||
|
ParseActorCommands( L, sCommands );
|
||||||
LuaReference *pRet = new LuaReference;
|
LuaReference *pRet = new LuaReference;
|
||||||
pRet->SetFromStack( L );
|
pRet->SetFromStack( L );
|
||||||
LUA->Release( L );
|
LUA->Release( L );
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ namespace ActorUtil
|
|||||||
void Register( const RString& sClassName, CreateActorFn pfn );
|
void Register( const RString& sClassName, CreateActorFn pfn );
|
||||||
Actor* Create( const RString& sClassName, const RString& sDir, const XNode* pNode, Actor *pParentActor );
|
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 );
|
apActorCommands ParseActorCommands( const RString &sCommands );
|
||||||
void SetXY( Actor& actor, const RString &sType );
|
void SetXY( Actor& actor, const RString &sType );
|
||||||
void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName );
|
void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName );
|
||||||
|
|||||||
Reference in New Issue
Block a user