Break out on result of secondary key checks

This commit is contained in:
Wolfsblvt 2024-07-05 21:16:43 +02:00
parent 6da36c630e
commit f7abd3f5d9
1 changed files with 4 additions and 1 deletions

View File

@ -3735,15 +3735,18 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
if (selectiveLogic === world_info_logic.NOT_ANY && !hasAnyMatch) { if (selectiveLogic === world_info_logic.NOT_ANY && !hasAnyMatch) {
console.debug(`[WI] Entry ${entry.uid} activated. (NOT ANY) No secondary keywords found`, entry.keysecondary); console.debug(`[WI] Entry ${entry.uid} activated. (NOT ANY) No secondary keywords found`, entry.keysecondary);
activatedNow.add(entry); activatedNow.add(entry);
break primary;
} }
// Handle AND ALL logic // Handle AND ALL logic
if (selectiveLogic === world_info_logic.AND_ALL && hasAllMatch) { if (selectiveLogic === world_info_logic.AND_ALL && hasAllMatch) {
console.debug(`[WI] Entry ${entry.uid} activated. (AND ALL) All secondary keywords found`, entry.keysecondary); console.debug(`[WI] Entry ${entry.uid} activated. (AND ALL) All secondary keywords found`, entry.keysecondary);
activatedNow.add(entry); activatedNow.add(entry);
break primary;
} }
// console.debug(`[WI] Entry ${entry.uid} skipped. Secondary keywords not satisfied`, entry.keysecondary); console.debug(`[WI] Entry ${entry.uid} skipped. Secondary keywords not satisfied`, entry.keysecondary);
break primary;
} else { } else {
// Handle cases where secondary is empty // Handle cases where secondary is empty
console.debug(`[WI] Entry ${entry.uid} activated by primary keyword`, substituted); console.debug(`[WI] Entry ${entry.uid} activated by primary keyword`, substituted);