View Single Post
12-26-11, 06:58 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You don't even need to store a variable. If you only want to know if any totem is active, you can return out of your function immediately as soon as you find one, without continuing to loop through the rest of the totem slots. You also don't need to explicitly return false, as a nil value is the same.

Code:
local function HasActiveTotem()
     for i = 1, 4 do
          if GetTotemInfo(i) then
               return true
          end
     end
end
  Reply With Quote