Don't force avatar on neutral assistant chat

This commit is contained in:
Wolfsblvt 2024-09-10 19:44:27 +02:00
parent 9e73e2598e
commit a989ccf318
1 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import {
main_api, main_api,
name1, name1,
name2, name2,
neutralCharacterName,
reloadCurrentChat, reloadCurrentChat,
removeMacros, removeMacros,
renameCharacter, renameCharacter,
@ -3129,7 +3130,10 @@ export async function sendMessageAs(args, text) {
const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name); const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name);
let force_avatar, original_avatar; let force_avatar, original_avatar;
if (this_chid !== undefined && characters[this_chid] === character) { const chatCharacter = this_chid !== null ? characters[this_chid] : null;
const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName;
if (chatCharacter === character || isNeutralCharacter) {
// If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars // If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars
} }
else if (character && character.avatar !== 'none') { else if (character && character.avatar !== 'none') {