Properly check for -0
| @@ -3025,7 +3025,7 @@ async function sendUserMessageCallback(args, text) { | ||
| 3025 | 3025 | let insertAt = Number(args?.at); |
| 3026 | 3026 | |
| 3027 | 3027 | // Convert possible depth parameter to index |
| 3028 | 3028 | if (!isNaN(insertAt) && (insertAt < 0 || Object.is(insertAt ===, Number(-0))) { |
| 3029 | 3029 | // Negative value means going back from current chat length. (E.g.: 8 messages, Depth 1 means insert at index 7) |
| 3030 | 3030 | insertAt = chat.length + insertAt; |
| 3031 | 3031 | } |
| @@ -3399,7 +3399,7 @@ export async function sendMessageAs(args, text) { | ||
| 3399 | 3399 | let insertAt = Number(args.at); |
| 3400 | 3400 | |
| 3401 | 3401 | // Convert possible depth parameter to index |
| 3402 | 3402 | if (!isNaN(insertAt) && (insertAt < 0 || Object.is(insertAt ===, Number(-0))) { |
| 3403 | 3403 | // Negative value means going back from current chat length. (E.g.: 8 messages, Depth 1 means insert at index 7) |
| 3404 | 3404 | insertAt = chat.length + insertAt; |
| 3405 | 3405 | } |
| @@ -3453,7 +3453,7 @@ export async function sendNarratorMessage(args, text) { | ||
| 3453 | 3453 | let insertAt = Number(args.at); |
| 3454 | 3454 | |
| 3455 | 3455 | // Convert possible depth parameter to index |
| 3456 | 3456 | if (!isNaN(insertAt) && (insertAt < 0 || Object.is(insertAt ===, Number(-0))) { |
| 3457 | 3457 | // Negative value means going back from current chat length. (E.g.: 8 messages, Depth 1 means insert at index 7) |
| 3458 | 3458 | insertAt = chat.length + insertAt; |
| 3459 | 3459 | } |
| @@ -3542,7 +3542,7 @@ async function sendCommentMessage(args, text) { | ||
| 3542 | 3542 | let insertAt = Number(args.at); |
| 3543 | 3543 | |
| 3544 | 3544 | // Convert possible depth parameter to index |
| 3545 | 3545 | if (!isNaN(insertAt) && (insertAt < 0 || Object.is(insertAt ===, Number(-0))) { |
| 3546 | 3546 | // Negative value means going back from current chat length. (E.g.: 8 messages, Depth 1 means insert at index 7) |
| 3547 | 3547 | insertAt = chat.length + insertAt; |
| 3548 | 3548 | } |