Thread Tools Display Modes
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
03-30-15, 01:15 AM   #22
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Well that was it, thanks
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Issue with UnitBuff

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off