From d365e1c1cb8b51015321b3f0c9d4f18ba6a11917 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 16 Jul 2018 14:40:53 +0200 Subject: [PATCH] tracking: reduce memory footprint --- modules/tracking.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/tracking.lua b/modules/tracking.lua index 03a9a642..50734869 100644 --- a/modules/tracking.lua +++ b/modules/tracking.lua @@ -138,6 +138,7 @@ pfUI:RegisterModule("tracking", function () for spellIndex = offset + 1, offset + numSpells do local spellTexture = GetSpellTexture(spellIndex, BOOKTYPE_SPELL) + -- scan for generic tracking icons for _, texture in pairs(knownTrackingSpellTextures["any"]) do if strfind(spellTexture, texture) and not state.spells[texture] then state.spells[texture] = { @@ -148,13 +149,16 @@ pfUI:RegisterModule("tracking", function () end end - for _, texture in pairs((knownTrackingSpellTextures[playerClass] or {})) do - if strfind(spellTexture, texture) and not state.spells[texture] then - state.spells[texture] = { - index = spellIndex, - name = GetSpellName(spellIndex, BOOKTYPE_SPELL), - texture = spellTexture - } + -- scan class specific tracking icons + if knownTrackingSpellTextures[playerClass] then + for _, texture in pairs(knownTrackingSpellTextures[playerClass]) do + if strfind(spellTexture, texture) and not state.spells[texture] then + state.spells[texture] = { + index = spellIndex, + name = GetSpellName(spellIndex, BOOKTYPE_SPELL), + texture = spellTexture + } + end end end end