diff options
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")) |
