diff classes/MultiCastButton.lua @ 168:07c76dbc0236

minor cleanup for multicastbutton (drycoded)
author Flick <flickerstreak@gmail.com>
date Tue, 19 Oct 2010 17:08:48 +0000
parents eab7e7642dd6
children 8cc187143acd
line wrap: on
line diff
--- a/classes/MultiCastButton.lua	Tue Oct 19 16:49:40 2010 +0000
+++ b/classes/MultiCastButton.lua	Tue Oct 19 17:08:48 2010 +0000
@@ -111,7 +111,9 @@
     totemIDsBySlot[i] = self:GetAttribute("TOTEM_PRIORITY_"..i)
   end
 
-  summonSpells = summonSpells or newtable() -- set up in bar:SetupBarHeader()
+  -- these are set up in bar:SetupBarHeader()
+  flyoutChildren = flyoutChildren or newtable()
+  summonSpells = summonSpells or newtable()
 ]]
 
 local _onstate_multispellpage = -- function(self, stateid, newstate)
@@ -166,11 +168,11 @@
     else
       local offset = summonSlot or 0
       local totemID = totemIDsBySlot[slot - offset]
-      local spells = newtable( 0, GetMultiCastTotemSpells(totemID) )
-      if spells[page] then
+      local spell = select(page, 0, GetMultiCastTotemSpells(totemID) )
+      if spell then
         b:SetAttribute("type","multispell")
         b:SetAttribute("action", baseActionID + (currentPage - 1)*slotsPerPage + totemID)
-        b:SetAttribute("spell", spells[page])
+        b:SetAttribute("spell", spell)
         b:Show()
         lastButton = b
         lastPage = page