View Single Post
03-30-15, 01:13 AM   #21
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
It seems to me like your code loops over all the possible flask values and checks all of them without stopping if it actually finds one. Therefore the flask value keeps getting overwritten and the answer you get eventually is the value for the last flask in your list.
You could try to modify your loop like this:
Lua Code:
  1. for i = 1, #flasks do
  2.     flask = UnitBuff("player", flasks[i])
  3.     if flask then
  4.         break
  5.     end
  6. end
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote