Prefer current char if multiple have the same name - Match against current chat character first - Also removed avatar-key matching, it was broken

6714bb8c1506e6917b7aaad3e8e57379aac8e0f6

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -3Showing whitespace changes
public/scripts/slash-commands.js+3 -3
@@ -3138,12 +3138,12 @@ export async function sendMessageAs(args, text) {
3138 const isSystem = bias && !removeMacros(mesText).length;3138 const isSystem = bias && !removeMacros(mesText).length;
3139 const compact = isTrueBoolean(args?.compact);3139 const compact = isTrueBoolean(args?.compact);
31403140
3141 const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name);
3142 let force_avatar, original_avatar;
3143
3144 const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;3141 const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;
3145 const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;3142 const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;
31463143
3144 const character = chatCharacter.name === name ? chatCharacter : characters.find(x => x.name === name);
3145 let force_avatar, original_avatar;
3146
3147 if (chatCharacter === character || isNeutralCharacter) {3147 if (chatCharacter === character || isNeutralCharacter) {
3148 // If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars3148 // If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars
3149 }3149 }