SWORD25: Fix infinite recursion

If I understand this, we don't need to call Kernel::GetInstance()
when we are already in the Kernel class. In this particular case,
_RegisterScriptBindings() is called from the Kernel constructor, so
it gets called again and again because _Instance hasn't yet been set.

svn-id: r53512
This commit is contained in:
Torbjörn Andersson 2010-10-15 20:01:13 +00:00
parent b184d7bbdb
commit 9744167adc

View file

@ -723,7 +723,7 @@ static const luaL_reg PERSISTENCE_FUNCTIONS[] = {
// -----------------------------------------------------------------------------
bool Kernel::_RegisterScriptBindings() {
ScriptEngine *pScript = Kernel::GetInstance()->GetScript();
ScriptEngine *pScript = GetScript();
BS_ASSERT(pScript);
lua_State *L = static_cast<lua_State *>(pScript->getScriptObject());
BS_ASSERT(L);