diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-02-21 05:36:35 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-02-21 05:36:35 +0200 |
| commit | 385838c935a71e2f87c390a3b00c6751e7bcb087 (patch) | |
| tree | 6b87feadc93275aa11ee068306cfcf488a45002e /indra/newview/llpreviewscript.cpp | |
| parent | a0e31b1c80bdc6553e7170886ead1c394114eb25 (diff) | |
#3423 Handle region properly
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c540046df1..c5949b46cd 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2481,13 +2481,16 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) bool lua_scripts_enabled = false; - // TODO: better handling of this - LLViewerRegion* region = gAgent.getRegion(); - if (region && region->simulatorFeaturesReceived()) + LLViewerObject* object = gObjectList.findObject(object_id); + if (object) { - LLSD simulatorFeatures; - region->getSimulatorFeatures(simulatorFeatures); - lua_scripts_enabled = simulatorFeatures["LuaScriptsEnabled"].asBoolean(); + LLViewerRegion* region = object->getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + LLSD simulatorFeatures; + region->getSimulatorFeatures(simulatorFeatures); + lua_scripts_enabled = simulatorFeatures["LuaScriptsEnabled"].asBoolean(); + } } if (LLScrollListItem* luau_item = instance->mCompileTarget->findItemByValue("luau")) |
