diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-08-06 18:00:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 18:00:32 +0300 |
commit | 0bf3b61457e7c77e91fb03d91b4caf0d702f99fa (patch) | |
tree | 8f43417c7f5605c3cee9a4d5c9fe255abbd63b4a /indra/newview/llappviewer.cpp | |
parent | cf29b701b19644062a1428a64023c3cf9829e2de (diff) | |
parent | 628cd605080546c400d3343bf0834bebf693bbcf (diff) |
Merge branch 'release/luau-scripting' into lua-ui-visibility
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ef12fe0bd3..ff29f64aeb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -113,6 +113,7 @@ #include "llgltfmateriallist.h" // Linden library includes +#include "fsyspath.h" #include "llavatarnamecache.h" #include "lldiriterator.h" #include "llexperiencecache.h" @@ -1216,8 +1217,23 @@ bool LLAppViewer::init() "--luafile", "LuaScript", [](const LLSD& script) { - // no completion callback: we don't need to know - LLLUAmanager::runScriptFile(script); + LLSD paths(gSavedSettings.getLLSD("LuaCommandPath")); + LL_DEBUGS("Lua") << "LuaCommandPath = " << paths << LL_ENDL; + for (const auto& path : llsd::inArray(paths)) + { + // if script path is already absolute, operator/() preserves it + auto abspath(fsyspath(gDirUtilp->getAppRODataDir()) / path.asString()); + auto absscript{ (abspath / script.asString()) }; + std::error_code ec; + if (std::filesystem::exists(absscript, ec)) + { + // no completion callback: we don't need to know + LLLUAmanager::runScriptFile(absscript.u8string()); + return; // from lambda + } + } + LL_WARNS("Lua") << "--luafile " << std::quoted(script.asString()) + << " not found on " << paths << LL_ENDL; }); processComposeSwitch( "LuaAutorunPath", "LuaAutorunPath", |