From 0c6885a4534e0822b7e12c1699467e7b61c5c739 Mon Sep 17 00:00:00 2001 From: Bronya Rand Date: Mon, 4 Dec 2023 18:40:33 -0600 Subject: [PATCH] fix comments and debug text --- public/scripts/world-info.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 9b259548e..aab4170c0 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1791,25 +1791,26 @@ async function checkWorldInfo(chat, maxContext) { hasAnyMatch = true; } - // Simplified AND/NAND if statement. (Proper fix for PR#1356 by Bronya) - // If AND logic and the main checks pass OR if NOT logic and the main checks do not pass + // Simplified AND ONE/NOT ONE (AND/NOR) if statement. (Proper fix for PR#1356 by Bronya) + // If AND ONE logic and the main checks pass OR if NOT ONE logic and the main checks do not pass if ((selectiveLogic === world_info_logic.AND && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) { // Differ both logic statements in the debugger if (selectiveLogic === world_info_logic.AND) { - console.debug(`(AND Check) Activating WI Entry ${entry.uid}. Found match for word: ${substituted} ${secondarySubstituted}`); + console.debug(`(AND ONE Check) Activating WI Entry ${entry.uid}. Found match for word: ${substituted} ${secondarySubstituted}`); } else { - console.debug(`(NOT AND Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword: ${secondarySubstituted}`); + console.debug(`(NOT ONE Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword: ${secondarySubstituted}`); } activatedNow.add(entry); break secondary; } } - // Handle NOT OR logic + // Handle NOT ALL (NOT AND) logic if (selectiveLogic === world_info_logic.NOT_ONE && !hasAnyMatch) { - console.debug(`(NOT OR Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword.`); + console.debug(`(NOT ALL Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword.`); activatedNow.add(entry); } + // Handle cases where secondary is empty } else { console.debug(`WI UID ${entry.uid}: Activated without filter logic.`);