From ca7c0e23f156e6a699427e90a5b3cf42a148600d Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 15 Sep 2014 14:33:07 +0200 Subject: [PATCH] Fix r2ed --- code/ryzom/client/src/far_tp.cpp | 2 +- code/ryzom/client/src/r2/dmc/com_lua_module.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 5ecd90c9c..2fb3f0c37 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -1132,7 +1132,7 @@ void CFarTP::disconnectFromPreviousShard() */ NetMngr.reinit(); - if( !isReselectingChar() ) + if (isIngame()) { nlinfo("FarTP: calling EntitiesMngr.reinit()"); EntitiesMngr.reinit(); diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index b91aca95c..c9b6a6df2 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -238,7 +238,15 @@ void CComLuaModule::initLuaLib() }; int initialStackSize = lua_gettop(_LuaState); #if LUA_VERSION_NUM >= 502 - luaL_newlib(_LuaState, methods); + // luaL_newlib(_LuaState, methods); + // lua_setglobal(_LuaState, R2_LUA_PATH); + lua_getglobal(_LuaState, R2_LUA_PATH); + if (lua_isnil(_LuaState, -1)) + { + lua_pop(_LuaState, 1); + lua_newtable(_LuaState); + } + luaL_setfuncs(_LuaState, methods, 0); lua_setglobal(_LuaState, R2_LUA_PATH); #else luaL_openlib(_LuaState, R2_LUA_PATH, methods, 0);