From e3dc99e078c0147927a184934187ca62b24f4cc5 Mon Sep 17 00:00:00 2001 From: Ulu Kyn Date: Wed, 25 Sep 2019 13:07:23 +0200 Subject: [PATCH] Fixed: Change way to load lua zone files when are in a bnp --HG-- branch : ark --- code/ryzom/client/src/continent.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/continent.cpp b/code/ryzom/client/src/continent.cpp index 51334195b..f0f007ef7 100644 --- a/code/ryzom/client/src/continent.cpp +++ b/code/ryzom/client/src/continent.cpp @@ -113,7 +113,7 @@ extern CContinentManager ContinentMngr; extern CEntityManager EntitiesMngr; //----------------------------------------------- -// CUserLandMark +// CUserLandMark //----------------------------------------------- NLMISC::CRGBA CUserLandMark::getColor () const @@ -742,20 +742,28 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress for (uint i = 0; i < zonesAdded.size(); i++) { - CSString luaScript; string luaScriptName = CPath::lookup(zonesAdded[i]+".lua", false); + if (!luaScriptName.empty()) { - luaScript.readFromFile(luaScriptName); - CLuaManager::getInstance().executeLuaScript(luaScript, true); - nlinfo("loading %s", luaScriptName.c_str()); + CIFile in; + if (in.open(luaScriptName)) + { + + string luaScript; + if (in.readAll(luaScript)) + { + CLuaManager::getInstance().executeLuaScript(luaScript, true); + nlinfo("loading %s", luaScriptName.c_str()); + } + } } else { nlinfo("file not found %s", luaScriptName.c_str()); } } - + LandscapeIGManager.unloadArrayZoneIG(zonesRemoved); LandscapeIGManager.loadArrayZoneIG(zonesAdded, &igAdded); }