diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index 82ce6707ee..6f3185e9c0 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -10,14 +10,7 @@ #include #include -/* -#include "Actor.h" -void foo() -{ - Actor *p = NULL; - LuaHelpers::Push( p, NULL ); -} -*/ + LuaManager *LUA = NULL; static LuaFunctionList *g_LuaFunctions = NULL; @@ -171,6 +164,9 @@ LuaManager::~LuaManager() void LuaManager::RegisterTypes() { + for( const LuaFunctionList *p = g_LuaFunctions; p; p=p->next ) + lua_register( L, p->name, p->func ); + if( g_vRegisterActorTypes ) { for( unsigned i=0; isize(); i++ ) @@ -201,9 +197,6 @@ void LuaManager::ResetState() luaopen_table( L ); lua_settop(L, 0); // luaopen_* pushes stuff onto the stack that we don't need - for( const LuaFunctionList *p = g_LuaFunctions; p; p=p->next ) - lua_register( L, p->name, p->func ); - RegisterTypes(); LuaReference::AfterResetAll(); diff --git a/stepmania/src/LuaManager.h b/stepmania/src/LuaManager.h index ea2b959a20..f27425cce7 100644 --- a/stepmania/src/LuaManager.h +++ b/stepmania/src/LuaManager.h @@ -53,9 +53,6 @@ public: bool RunScriptFile( const CString &sFile ); - /* Register all subscribing types. There's no harm in registering when already registered. */ - void RegisterTypes(); - /* Reset the environment, freeing any globals left over by previously executed scripts. */ void ResetState(); @@ -97,6 +94,10 @@ public: static void ReadArrayFromTableB( vector &aOut, lua_State *L = NULL ); lua_State *L; + +private: + /* Register all subscribing types. There's no harm in registering when already registered. */ + void RegisterTypes(); };