From b513043e4acfba2cd6582dac69d3902039814a5c Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:04:49 +0300 Subject: [PATCH] Prevent sticky from using probability --- public/scripts/world-info.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index aa852506e..02037f686 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -3260,9 +3260,12 @@ async function checkWorldInfo(chat, maxContext, isDryRun) { const rollValue = Math.random() * 100; if (entry.useProbability && rollValue > entry.probability) { - console.debug(`WI entry ${entry.uid} ${entry.key} failed probability check, skipping`); - failedProbabilityChecks.add(entry); - continue; + const isSticky = timedEvents.isStickyActivated(entry); + if (!isSticky) { + console.debug(`WI entry ${entry.uid} ${entry.key} failed probability check, skipping`); + failedProbabilityChecks.add(entry); + continue; + } } else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); } // Substitute macros inline, for both this checking and also future processing