fix bugs for classes that dont have any stances (yet)

This commit is contained in:
Hendrik Leppkes
2008-02-21 16:53:12 +00:00
parent 17ed1caa90
commit 720bd42401
3 changed files with 10 additions and 3 deletions
+4
View File
@@ -146,6 +146,10 @@ function ButtonBar:UpdateButtonLayout()
local numbuttons = #buttons
local pad = self:GetPadding()
-- bail out if the bar has no buttons, for whatever reason
-- (eg. stanceless class, or no stances learned yet, etc.)
if numbuttons == 0 then return end
local Rows = self:GetRows()
local ButtonPerRow = math_floor(numbuttons / Rows + 0.5) -- just a precaution
Rows = math_floor(numbuttons / ButtonPerRow + 0.5)