Dont count Continue as message 0 (#3594)

* continue works same as swipe continued message isn't depth counted

* correct early-out check

* update regex depth setting tooltips for accuracy

* update max tooltip

* remove redundant check

* Allow -1 as a min depth value

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
Reithan
2025-03-12 10:59:15 -07:00
committed by GitHub
parent 1b02426df1
commit 01ef823da9
3 changed files with 8 additions and 8 deletions

View File

@ -103,8 +103,8 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown,
}
// Check if the depth is within the min/max depth
if (typeof depth === 'number' && depth >= 0) {
if (!isNaN(script.minDepth) && script.minDepth !== null && script.minDepth >= 0 && depth < script.minDepth) {
if (typeof depth === 'number') {
if (!isNaN(script.minDepth) && script.minDepth !== null && script.minDepth >= -1 && depth < script.minDepth) {
console.debug(`getRegexedString: Skipping script ${script.scriptName} because depth ${depth} is less than minDepth ${script.minDepth}`);
return;
}
@ -139,7 +139,7 @@ function runRegexScript(regexScript, rawString, { characterOverride } = {}) {
}
const getRegexString = () => {
switch(Number(regexScript.substituteRegex)) {
switch (Number(regexScript.substituteRegex)) {
case substitute_find_regex.NONE:
return regexScript.findRegex;
case substitute_find_regex.RAW: