diff options
| author | Rider Linden <rider@lindenlab.com> | 2026-08-25 15:18:30 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2026-08-25 15:18:30 -0700 |
| commit | d2dbd068fe99d88c371588565af1b1eaeb02441e (patch) | |
| tree | c5ccf5064b1a17310c78dbc00bb432dbb52dcb87 | |
| parent | f6f5cd0f888dd8ec53821aa4f26e307b51465da0 (diff) | |
Issue #6180: If the run state is missing from the save message, use the old run state.
| -rw-r--r-- | doc/external-editor-json-rpc.md | 6 | ||||
| -rw-r--r-- | indra/newview/llscripteditorws.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/doc/external-editor-json-rpc.md b/doc/external-editor-json-rpc.md index 6fd5d20eea..8b69c80fff 100644 --- a/doc/external-editor-json-rpc.md +++ b/doc/external-editor-json-rpc.md @@ -1220,7 +1220,7 @@ interface ObjectContentSaveParams { item_id: string; content: string; vm?: "mono" | "lsl2" | "luau"; - running?: boolean; // Scripts only: run state applied after compilation. Defaults to false. + running?: boolean; // Scripts only: run state applied after compilation when supplied. } interface ObjectContentSaveResponse { @@ -1238,12 +1238,12 @@ interface ObjectContentSaveResponse { - `item_id`: UUID of the saved inventory item. - `content`: Raw script/notecard source text to store. - `vm` (optional): Scripts only compile target. Accepted values are `"mono"`, `"lsl2"`, `"luau"`. When `"luau"` is specified for an LSL script (as opposed to a native Luau script), the viewer automatically selects the correct LSL-on-Luau compile path. If omitted, inferred from item metadata or content analysis. -- `running` (optional): Scripts only. The run state the viewer applies to the script once the upload and compilation complete. Defaults to `false` when omitted. To preserve a script's current run state across a save, echo the `running` value from the corresponding `ObjectInventoryItem` in the most recent `object.publish` or `object.update`. +- `running` (optional): Scripts only. When provided, the viewer applies that run state after upload and compilation. When omitted, the viewer preserves the script's current run state and does not force it off. - `success`: Whether the upload/save operation succeeded. - `compiled` (optional): Scripts only. `true` when compilation succeeded, `false` when source saved but compile failed. - `diagnostics` (optional): Scripts only. Compiler diagnostics when `compiled` is `false`. -> **Warning:** Omitting `running` does not leave the script's run state unchanged — it stops the script. A client that saves a running script without sending `running: true` will silently stop it. +> **Note:** Omitting `running` leaves the script's existing run state unchanged. Only an explicit `true` or `false` changes the post-save state. **Permissions.** Requires `PERM_MODIFY` on the item and modify permission on the containing prim. See [Common preconditions](#common-preconditions) for the shared checks and errors. diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index f886be819f..01f0e60a49 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -1523,7 +1523,11 @@ LLSD LLScriptEditorWSServer::saveScript(LLViewerObject* prim, LLInventoryItem* i [&, prim_id, item_id](const std::string& pump_name) { auto [on_success, on_failure] = make_asset_upload_callbacks(pump_name); - bool is_running = params.has("running") ? params["running"].asBoolean() : false; + bool is_running = item->getIsRunning(); + if (params.has("running")) + { + is_running = params["running"].asBoolean(); + } LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared<LLScriptAssetUpload>( prim_id, item_id, compile_target, is_running, LLUUID::null, content, |
