Prevent sticky from using probability

This commit is contained in:
Cohee 2024-06-22 15:04:49 +03:00
parent 0fe19bca47
commit b513043e4a

View File

@ -3260,9 +3260,12 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
const rollValue = Math.random() * 100; const rollValue = Math.random() * 100;
if (entry.useProbability && rollValue > entry.probability) { if (entry.useProbability && rollValue > entry.probability) {
const isSticky = timedEvents.isStickyActivated(entry);
if (!isSticky) {
console.debug(`WI entry ${entry.uid} ${entry.key} failed probability check, skipping`); console.debug(`WI entry ${entry.uid} ${entry.key} failed probability check, skipping`);
failedProbabilityChecks.add(entry); failedProbabilityChecks.add(entry);
continue; continue;
}
} else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); } } else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
// Substitute macros inline, for both this checking and also future processing // Substitute macros inline, for both this checking and also future processing