fix: refine mana panel item filtering

This commit is contained in:
Erik 2026-03-13 08:31:16 +01:00
parent b204ba8e75
commit 0cb8e2f75a

View file

@ -1494,6 +1494,7 @@ function getManaTrackedItems(state) {
const snapshotMs = Date.now(); const snapshotMs = Date.now();
return state.items return state.items
.filter(item => (item.current_wielded_location || 0) > 0) .filter(item => (item.current_wielded_location || 0) > 0)
.filter(item => !isAetheriaItem(item))
.filter(item => { .filter(item => {
const spellInfo = item.spells; const spellInfo = item.spells;
const hasSpellData = const hasSpellData =
@ -1579,6 +1580,11 @@ function isHandEquippedItem(item) {
); );
} }
function isAetheriaItem(item) {
const mask = Number(item?.current_wielded_location || 0);
return mask === 268435456 || mask === 536870912 || mask === 1073741824;
}
function deriveManaStateFromCharacterStats(item, characterName) { function deriveManaStateFromCharacterStats(item, characterName) {
const stats = characterStats[characterName]; const stats = characterStats[characterName];
const activeEnchantments = stats?.active_item_enchantments; const activeEnchantments = stats?.active_item_enchantments;
@ -1600,11 +1606,10 @@ function deriveManaStateFromCharacterStats(item, characterName) {
return 'active'; return 'active';
} }
if (!Array.isArray(activeEnchantments) || activeEnchantments.length === 0) {
if (isHandEquippedItem(item)) { if (isHandEquippedItem(item)) {
return 'not_active'; return 'not_active';
} }
if (!Array.isArray(activeEnchantments) || activeEnchantments.length === 0) {
return allMatchedOnItem ? 'active' : item.mana_state; return allMatchedOnItem ? 'active' : item.mana_state;
} }