Quantcast

added talent option to AddIcon

Sidoine De Wispelaere [05-24-10 - 12:37]
added talent option to AddIcon

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@256 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCompile.lua
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index e0e8826..514f787 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -288,6 +288,9 @@ local function ParseAddIcon(params, text)
 	-- On convertit le numéro de node en node
 	masterNode = node[tonumber(masterNode)]
 	masterNode.params = ParseParameters(params)
+	if masterNode.params.talent and not HasTalent(masterNode.params.talent) then
+		return nil
+	end
 	return masterNode
 end

@@ -367,7 +370,10 @@ function Ovale:Compile(text)

 	-- On compile les AddIcon
 	for p,t in string.gmatch(text, "AddIcon%s*(.-)%s*(%b{})") do
-		masterNodes[#masterNodes+1] = ParseAddIcon(p,t)
+		local newNode = ParseAddIcon(p,t)
+		if newNode then
+			masterNodes[#masterNodes+1] = newNode
+		end
 	end
 	return masterNodes
 end