Tag import fixed, again. (accepts char avatar key)

This commit is contained in:
Wolfsblvt 2024-08-19 21:23:22 +02:00
parent 02d6df3ace
commit 29a1f777dc
1 changed files with 5 additions and 1 deletions

View File

@ -445,7 +445,11 @@ export function getTagKeyForEntity(entityOrKey) {
}
// Next lets check if its a valid character or character id, so we can swith it to its tag
const character = characters.indexOf(x) >= 0 ? x : characters[x];
let character;
if (!character && characters.indexOf(x) >= 0) character = x; // Check for char object
if (!character && typeof x === 'number') character = characters[x]; // check if its a char id
if (!character) character = characters.find(y => y.avatar === x); // check if its a char key
if (character) {
x = character.avatar;
}