mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
proper revert cuz vsc revert weird...
This commit is contained in:
@@ -4072,8 +4072,8 @@
|
|||||||
<small class="textAlignCenter">Logic</small>
|
<small class="textAlignCenter">Logic</small>
|
||||||
<select name="entryLogicType" class="widthFitContent margin0">
|
<select name="entryLogicType" class="widthFitContent margin0">
|
||||||
<option value="0">AND ONE</option>
|
<option value="0">AND ONE</option>
|
||||||
<option value="1">NOT ONE</option>
|
<option value="1">NOT ALL</option>
|
||||||
<option value="2">NOT ALL</option>
|
<option value="2">NOT ONE</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="world_entry_form_control keysecondary flex1">
|
<div class="world_entry_form_control keysecondary flex1">
|
||||||
@@ -4943,4 +4943,4 @@
|
|||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@@ -37,8 +37,8 @@ const world_info_insertion_strategy = {
|
|||||||
|
|
||||||
const world_info_logic = {
|
const world_info_logic = {
|
||||||
AND_ONE: 0,
|
AND_ONE: 0,
|
||||||
NOT_ONE: 1,
|
NOT_ALL: 1,
|
||||||
NOT_ALL: 2,
|
NOT_ONE: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
let world_info = {};
|
let world_info = {};
|
||||||
@@ -1791,26 +1791,25 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
hasAnyMatch = true;
|
hasAnyMatch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simplified AND ONE / NOT ONE if statement. (Proper fix for PR#1356 by Bronya)
|
// Simplified AND ONE / NOT ALL 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 AND ONE logic and the main checks pass OR if NOT ALL logic and the main checks do not pass
|
||||||
if ((selectiveLogic === world_info_logic.AND_ONE && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ONE && !hasSecondaryMatch)) {
|
if ((selectiveLogic === world_info_logic.AND_ONE && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) {
|
||||||
// Differ both logic statements in the debugger
|
// Differ both logic statements in the debugger
|
||||||
if (selectiveLogic === world_info_logic.AND_ONE) {
|
if (selectiveLogic === world_info_logic.AND_ONE) {
|
||||||
console.debug(`(AND ONE 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 {
|
} else {
|
||||||
console.debug(`(NOT ONE Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword: ${secondarySubstituted}`);
|
console.debug(`(NOT ALL Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword: ${secondarySubstituted}`);
|
||||||
}
|
}
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
break secondary;
|
break secondary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle NOT ALL logic
|
// Handle NOT ONE logic
|
||||||
if (selectiveLogic === world_info_logic.NOT_ALL && !hasAnyMatch) {
|
if (selectiveLogic === world_info_logic.NOT_ONE && !hasAnyMatch) {
|
||||||
console.debug(`(NOT ALL Check) Activating WI Entry ${entry.uid}, no secondary keywords found.`);
|
console.debug(`(NOT ONE Check) Activating WI Entry ${entry.uid}, no secondary keywords found.`);
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle cases where secondary is empty
|
// Handle cases where secondary is empty
|
||||||
} else {
|
} else {
|
||||||
console.debug(`WI UID ${entry.uid}: Activated without filter logic.`);
|
console.debug(`WI UID ${entry.uid}: Activated without filter logic.`);
|
||||||
@@ -2487,4 +2486,4 @@ jQuery(() => {
|
|||||||
closeOnSelect: false,
|
closeOnSelect: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
Reference in New Issue
Block a user