Fixed: Change way to load lua zone files when are in a bnp

--HG--
branch : ark
hg/ark
Ulu Kyn 5 years ago
parent a4d2f80579
commit e3dc99e078

@ -742,13 +742,21 @@ 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
{

Loading…
Cancel
Save