Fix embedded lorebook depths

This commit is contained in:
Cohee 2023-09-25 20:11:16 +03:00
parent edb79d8c53
commit 01f14b461f
2 changed files with 4 additions and 2 deletions

View File

@ -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,
};
});

View File

@ -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);