diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 91c4e25bae..89fa895dac 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -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 ); diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 48485fbc20..a4c5efac0f 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -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 );