Quantcast

Fixed: Fixed a LUA error if used on Enhancement talent

Taracque [04-02-13 - 15:42]
Fixed: Fixed a LUA error if used on Enhancement talent
Filename
Change_log.txt
Elementarist.lua
Elementarist.toc
diff --git a/Change_log.txt b/Change_log.txt
index 46e3e99..09d681a 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,6 @@
+**v3.1.7**
+* Fixed: Fixed a LUA error if used on Enhancement talent
+
 **v3.1.6**
 * Fixed: More error check in CountPerson method

diff --git a/Elementarist.lua b/Elementarist.lua
index d7c3877..74ef19a 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Elementarist 3.1.6
+-- Elementarist 3.1.7
 --
 -- Shows the advised spell for an elemental shaman for optimal DPS output.
 -------------------------------------------------------------------------------
@@ -8,7 +8,7 @@ Elementarist = {Locals = {}}

 local L = Elementarist.Locals

-Elementarist.versionNumber = '3.1.6';
+Elementarist.versionNumber = '3.1.7';
 Elementarist.enabled = true;
 Elementarist.playerName = UnitName("player")
 Elementarist.playerGUID = UnitGUID("player")
@@ -851,43 +851,45 @@ function Elementarist:DecideSpells()

 	local spell = ""
 	spell = Elementarist:NextSpell()
-	Elementarist:FlashSpell(spell,"spell")
-	local d = Elementarist:GetSpellCooldownRemaining(spell)
-	if (d) and (d>0) then
-		local cdStart = currentTime - Elementarist.lastBaseGCD + d  -- should be less then the base gcd if we are suggesting it
-		if (cdStart) and (Elementarist.lastBaseGCD) then
-			Elementarist.cooldownFrame:SetCooldown(cdStart, Elementarist.lastBaseGCD)
+	if (spell) then
+		Elementarist:FlashSpell(spell,"spell")
+		local d = Elementarist:GetSpellCooldownRemaining(spell)
+		if (d) and (d>0) then
+			local cdStart = currentTime - Elementarist.lastBaseGCD + d  -- should be less then the base gcd if we are suggesting it
+			if (cdStart) and (Elementarist.lastBaseGCD) then
+				Elementarist.cooldownFrame:SetCooldown(cdStart, Elementarist.lastBaseGCD)
+			end
 		end
-	end
-	Elementarist:SetTexture(Elementarist.textureList["next"],GetSpellTexture(spell))
+		Elementarist:SetTexture(Elementarist.textureList["next"],GetSpellTexture(spell))

-	local _,_,_,_,_,_,ct1=GetSpellInfo(spell)
-	if (not ct1) then
-		ct1 = 0
-	else
-		ct1 = (ct1 / 1000)
-	end
-	local spell1 = Elementarist:NextSpell(ct1,spell)
-	Elementarist:SetTexture(Elementarist.textureList["next1"],GetSpellTexture(spell1))
+		local _,_,_,_,_,_,ct1=GetSpellInfo(spell)
+		if (not ct1) then
+			ct1 = 0
+		else
+			ct1 = (ct1 / 1000)
+		end
+		local spell1 = Elementarist:NextSpell(ct1,spell)
+		Elementarist:SetTexture(Elementarist.textureList["next1"],GetSpellTexture(spell1))

-	local _,_,_,_,_,_,ct2=GetSpellInfo(spell1)
-	if (not ct2) then
-		ct2 = 0
-	else
-		ct2 = (ct2 / 1000)
-	end
-	if (not ct2) or (ct2 < Elementarist.lastBaseGCD) then
-		ct2 = Elementarist.lastBaseGCD
+		local _,_,_,_,_,_,ct2=GetSpellInfo(spell1)
+		if (not ct2) then
+			ct2 = 0
+		else
+			ct2 = (ct2 / 1000)
+		end
+		if (not ct2) or (ct2 < Elementarist.lastBaseGCD) then
+			ct2 = Elementarist.lastBaseGCD
+		end
+		local spell2 = Elementarist:NextSpell(ct1+ct2,spell,spell1)
+		Elementarist:SetTexture(Elementarist.textureList["next2"],GetSpellTexture(spell2))
 	end
-	local spell2 = Elementarist:NextSpell(ct1+ct2,spell,spell1)
-	Elementarist:SetTexture(Elementarist.textureList["next2"],GetSpellTexture(spell2))
-
+
 	if (not ElementaristDB.disableMini) then
 		local icon
-
+
 		spell,icon = Elementarist:MiscSpell()
 		Elementarist:FlashSpell(spell,"misc")
-
+
 		if (icon) then
 			Elementarist:SetTexture(Elementarist.textureList["misc"],icon)
 		else
@@ -895,7 +897,7 @@ function Elementarist:DecideSpells()
 				Elementarist:SetTexture(Elementarist.textureList["misc"],GetSpellTexture(spell))
 			end
 		end
-
+
 		spell = Elementarist:IntSpell()
 		Elementarist:FlashSpell(spell,"int")
 		Elementarist:SetTexture(Elementarist.textureList["int"],GetSpellTexture(spell))
diff --git a/Elementarist.toc b/Elementarist.toc
index 0ad7264..6b5797f 100755
--- a/Elementarist.toc
+++ b/Elementarist.toc
@@ -2,7 +2,7 @@
 ## Title: Elementarist
 ## Notes: Elemental shaman spell rotation helper
 ## Author: Taracque, Felmosórongy of Arathor
-## Version: 3.1.6
+## Version: 3.1.7
 ## SavedVariables: ElementaristDB
 ## OptionalDeps: OmniCC, SpellFlash
 ## Dependencies: