Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-23-12, 02:23 PM   #1
whoarrior
A Deviate Faerie Dragon
 
whoarrior's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 14
if statement, where's my misconception? :(

Hey guys,

i'm looking at my code and don't see why it doesn't behave like i thought it should.

Code:
local buffList = {
    [1] = { id = "5171", name = "Slice and Dice" },
}

local function whoa_showBuff(id)
    for _,v in pairs(buffList) do
        print(v.id.."=="..id.."?")
        if (v.id == id) then
            print("yes")
            return true
        else
            print("no")
        end
    end
    return false
end
And the logging looks like...
Code:
5171==2823?
no
5171==5171?
no
What stupid mistake did i do?

Thanks in advance!
whoa
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » if statement, where's my misconception? :(


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