View Single Post
12-04-16, 12:02 AM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The iteration variable in a for lop should be isolated between each iteration. I ran the following test as proof.

Lua Code:
  1. local t={};
  2. for i=1,5 do
  3.     t[i]=function() print(i); end
  4. end
  5. for _,f in ipairs(t) do f(); end

This prints the following output.
Code:
1
2
3
4
5


In conclusion, something in your code is contaminating the variable in your for loop. Without being able to look through all of your code, there's no way to tell what's going on exactly.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote