From 385838c935a71e2f87c390a3b00c6751e7bcb087 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 21 Feb 2025 05:36:35 +0200 Subject: #3423 Handle region properly --- indra/newview/llpreviewscript.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') 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")) -- cgit v1.3