diff options
| author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-14 19:08:11 -0400 |
|---|---|---|
| committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-14 19:08:11 -0400 |
| commit | 66ff4c75bc2d594a41dfe22d85139311567b8e97 (patch) | |
| tree | 08eec3889838cebf272e10ee34153a91667d4781 /indra/newview/llcompilequeue.cpp | |
| parent | 0a32098d4a603bc2a25fc68bbeaa1e980f0c1fe1 (diff) | |
| parent | 305bebbdb3b16b10b6011b5b3b5d63ee7c7334be (diff) | |
Merge branch 'project/lua_editor' into pepper/pchat-revamp
Diffstat (limited to 'indra/newview/llcompilequeue.cpp')
| -rw-r--r-- | indra/newview/llcompilequeue.cpp | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index e0f464168c..ba19135fce 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -52,7 +52,6 @@ #include "lldir.h" #include "llnotificationsutil.h" #include "llviewerstats.h" -#include "llfilesystem.h" #include "lluictrlfactory.h" #include "lltrans.h" @@ -61,7 +60,6 @@ #include "llviewerassetupload.h" #include "llcorehttputil.h" -#include "llpreviewscript.h" namespace { @@ -463,31 +461,22 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat LLUUID assetId = result["asset_id"]; - // Check if this is a SLua script that shouldn't be recompiled to Mono/LSL - if (compile_target == "mono" || compile_target == "lsl2") - { - // Read the script from cache to check its type - LLFileSystem file(assetId, LLAssetType::AT_LSL_TEXT, LLFileSystem::READ); - if (file.getSize() > 0) - { - S32 file_length = file.getSize(); - std::vector<char> buffer(file_length + 1); - file.read((U8*)&buffer[0], file_length); - buffer[file_length] = 0; - std::string script_text(&buffer[0]); + const bool script_is_lua = item->getInventorySubType() == SST_LUA; + const bool target_is_lua = compile_target == "luau"; + const bool incompatible_language = target_is_lua != script_is_lua; - if (is_lua_script(script_text)) - { - // This is a SLua script - skip it with a warning - LLStringUtil::format_map_t args; - args["[SCRIPT_NAME]"] = inventory->getName(); - args["[TARGET]"] = (compile_target == "mono") ? "Mono" : "LSL"; - std::string buffer = floater->getString("SkippingSluaScript", args); - floater->addStringMessage(buffer); - LL_INFOS("SCRIPTQ") << "Skipping SLua script: " << inventory->getName() << LL_ENDL; - return true; - } - } + // Lua and LSL use different source languages, so do not send an incompatible + // script to the compiler. The inventory subtype identifies the source language. + if (incompatible_language) + { + LLStringUtil::format_map_t args; + args["[SCRIPT_NAME]"] = inventory->getName(); + args["[TARGET]"] = compile_target; + std::string buffer = floater->getString("SkippingIncompatibleScript", args); + floater->addStringMessage(buffer); + LL_INFOS("SCRIPTQ") << "Skipping incompatible script: " << inventory->getName() + << " (target " << compile_target << ")" << LL_ENDL; + return true; } std::string url = object->getRegion()->getCapability("UpdateScriptTask"); |
