Add a warning when compiling the script if the spell ID is unknown.
Johnny C. Lam [10-23-12 - 03:08]
Add a warning when compiling the script if the spell ID is unknown.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@616 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index dc18ec6..764dd85 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -184,11 +184,15 @@ local function ParseFunction(prefix, func, params)
local spellId = paramList[1]
if spellId and not OvaleData.spellList[spellId] then
local spellName = GetSpellInfo(spellId)
- if spellName == GetSpellInfo(spellName) then
- --Ovale:Print("Learning spell "..spellName.." with ID "..spellId)
- OvaleData.spellList[spellId] = spellName
+ if spellName then
+ if spellName == GetSpellInfo(spellName) then
+ Ovale:debugPrint("missing_spells", "Learning spell "..tostring(spellName).." with ID "..spellId)
+ OvaleData.spellList[spellId] = spellName
+ else
+ unknownSpellNodes[newNode.nodeId] = spellId
+ end
else
- unknownSpellNodes[newNode.nodeId] = spellId
+ Ovale:Print("Unknown spell with ID "..spellId)
end
end
end