From 01f14b461f6913f6131a6b2fac7495d07f8b5c1a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 25 Sep 2023 20:11:16 +0300 Subject: [PATCH] Fix embedded lorebook depths --- public/scripts/world-info.js | 3 ++- server.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index f174ef51d..4581670a7 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -699,7 +699,7 @@ function getWorldEntry(name, data, entry) { const value = Number($(this).val()); data.entries[uid].depth = !isNaN(value) ? value : 0; - setOriginalDataValue(data, uid, "depth", data.entries[uid].depth); + setOriginalDataValue(data, uid, "extensions.depth", data.entries[uid].depth); saveWorldInfo(name, data); }); depthInput.val(entry.depth ?? DEFAULT_DEPTH).trigger("input"); @@ -1465,6 +1465,7 @@ function convertCharacterBook(characterBook) { displayIndex: entry.extensions?.display_index ?? index, probability: entry.extensions?.probability ?? null, useProbability: entry.extensions?.useProbability ?? false, + depth: entry.extensions?.depth ?? DEFAULT_DEPTH, }; }); diff --git a/server.js b/server.js index cac751a54..b751f47a9 100644 --- a/server.js +++ b/server.js @@ -1695,7 +1695,8 @@ function convertWorldInfoToCharacterBook(name, entries) { display_index: entry.displayIndex, probability: entry.probability ?? null, useProbability: entry.useProbability ?? false, - } + depth: entry.depth ?? 4, + }, }; result.entries.push(originalEntry);