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();
return state.items
.filter(item => (item.current_wielded_location || 0) > 0)
.filter(item => !isAetheriaItem(item))
.filter(item => {
const spellInfo = item.spells;
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) {
const stats = characterStats[characterName];
const activeEnchantments = stats?.active_item_enchantments;
@ -1600,11 +1606,10 @@ function deriveManaStateFromCharacterStats(item, characterName) {
return 'active';
}
if (!Array.isArray(activeEnchantments) || activeEnchantments.length === 0) {
if (isHandEquippedItem(item)) {
return 'not_active';
}
if (!Array.isArray(activeEnchantments) || activeEnchantments.length === 0) {
return allMatchedOnItem ? 'active' : item.mana_state;
}