Quantcast

v7.2.5.2 - Optimizations and fixes

Pawel [07-23-17 - 00:41]
v7.2.5.2 - Optimizations and fixes
Filename
MaxDps.toc
core.lua
custom.lua
helper.lua
diff --git a/MaxDps.toc b/MaxDps.toc
index 8aee611..982ea48 100644
--- a/MaxDps.toc
+++ b/MaxDps.toc
@@ -1,6 +1,6 @@
 ## Title: MaxDps
 ## Notes: Rotation helper framework.
-## Version: 7.2.5.1
+## Version: 7.2.5.2
 ## Author: Kaminaris
 ## Interface: 70200
 ## SavedVariables: MaxDpsOptions
diff --git a/core.lua b/core.lua
index 992649d..c4027e9 100644
--- a/core.lua
+++ b/core.lua
@@ -321,9 +321,15 @@ function MaxDps:InvokeNextSpell()

 	if (oldSkill ~= self.Spell or oldSkill == nil) and self.Spell ~= nil then
 		self:GlowNextSpellId(self.Spell);
+		if WeakAuras then
+			WeakAuras.ScanEvents('MAXDPS_SPELL_UPDATE', self.Spell);
+		end
 	end
 	if self.Spell == nil and oldSkill ~= nil then
 		self:GlowClear();
+		if WeakAuras then
+			WeakAuras.ScanEvents('MAXDPS_SPELL_UPDATE', nil);
+		end
 	end
 end

diff --git a/custom.lua b/custom.lua
index a67e36f..5281658 100644
--- a/custom.lua
+++ b/custom.lua
@@ -372,6 +372,8 @@ local blockedFunctions = {
 	hash_SlashCmdList = true,
 	CreateMacro = true,
 	SetBindingMacro = true,
+	GuildDisband = true,
+	GuildUninvite = true,
 }

 local function forbidden()
diff --git a/helper.lua b/helper.lua
index d57db4f..55e3f7d 100644
--- a/helper.lua
+++ b/helper.lua
@@ -23,10 +23,9 @@ end

 function MaxDps:CheckTalents()
 	self.PlayerTalents = {};
-	self.PlayerSpec = GetActiveSpecGroup();
 	for talentRow = 1, 7 do
 		for talentCol = 1, 3 do
-			local _, name, _, sel, _, id = GetTalentInfo(talentRow, talentCol, self.PlayerSpec);
+			local _, name, _, sel, _, id = GetTalentInfo(talentRow, talentCol, 1);
 			if sel then
 				self.PlayerTalents[id] = name;
 			end
@@ -56,9 +55,10 @@ function MaxDps:TalentEnabled(talent)
 	return found;
 end

-function MaxDps:PersistentAura(name)
+function MaxDps:PersistentAura(name, unit)
+	unit = unit or 'player';
 	local spellName = GetSpellInfo(name);
-	local aura, _, _, count = UnitAura('player', spellName);
+	local aura, _, _, count = UnitAura(unit, spellName);
 	if aura then
 		return true, count;
 	end
@@ -176,13 +176,13 @@ function MaxDps:ExtractTooltip(spell, pattern)
 	local _pattern = gsub(pattern, "%%s", "([%%d%.,]+)");

 	if not TDSpellTooltip then
-		CreateFrame('GameTooltip', 'TDSpellTooltip', UIParent, 'GameTooltipTemplate');
+		CreateFrame('GameTooltip', 'MaxDpsSpellTooltip', UIParent, 'GameTooltipTemplate');
 		TDSpellTooltip:SetOwner(UIParent, "ANCHOR_NONE")
 	end
 	TDSpellTooltip:SetSpellByID(spell);

 	for i = 2, 4 do
-		local line = _G['TDSpellTooltipTextLeft' .. i];
+		local line = _G['MaxDpsSpellTooltipTextLeft' .. i];
 		local text = line:GetText();

 		if text then
@@ -273,12 +273,8 @@ end

 function MaxDps:TargetsInRange(spell)
 	local count = 0;
-	for i = 0, 1000, 1 do
-		local np = _G['NamePlate' .. i];
-		if np ~= nil and
-			np:IsVisible() and
-			MaxDps:IsSpellInRange(spell, np.UnitFrame.unit) == 1
-		then
+	for i, frame in pairs(C_NamePlate.GetNamePlates()) do
+		if frame:IsVisible() and MaxDps:IsSpellInRange(spell, frame.UnitFrame.unit) == 1 then
 			count = count + 1;
 		end
 	end