changeset 235:1663c78a7f31

Don't blow away config for buttons the current character doesn't have yet
author Flick
date Thu, 24 Mar 2011 12:58:27 -0700
parents 0e20f65375d5
children dcdc0235d489
files classes/Button.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/classes/Button.lua	Tue Mar 22 17:05:51 2011 -0700
+++ b/classes/Button.lua	Thu Mar 24 12:58:27 2011 -0700
@@ -155,6 +155,7 @@
 
   local r, c = bar:GetButtonGrid()
   local n = r*c
+  local cfgN = n
 
   local hint = nil
   local i = 1
@@ -164,7 +165,9 @@
       if i > n then
         bar:RemoveButton(b)
         b:Destroy()
-        btnCfg[i] = nil
+        if i > cfgN then
+          btnCfg[i] = nil
+        end
       else
         b:Refresh()
         hint = b:GetActionID()