mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 16:49:01 +01:00
Prefer current char if multiple have the same name
- Match against current chat character first - Also removed avatar-key matching, it was broken
This commit is contained in:
parent
c47e198664
commit
6714bb8c15
@ -3138,12 +3138,12 @@ export async function sendMessageAs(args, text) {
|
||||
const isSystem = bias && !removeMacros(mesText).length;
|
||||
const compact = isTrueBoolean(args?.compact);
|
||||
|
||||
const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name);
|
||||
let force_avatar, original_avatar;
|
||||
|
||||
const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;
|
||||
const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;
|
||||
|
||||
const character = chatCharacter.name === name ? chatCharacter : characters.find(x => x.name === name);
|
||||
let force_avatar, original_avatar;
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user