for (int i = 0; i < chestAmount; i++)
{
advance(chestIterator, i);
... use chestIterator ...
}
Iteration #1: chestIterator advances by 0, it points to element #0 (given that it is initialized to begin())
Iteration #2: chestIterator advances by 1, it points to element #1
Iteration #3: chestIterator advances by 2, it points to element #3
Iteration #4: chestIterator advances by 3, it points to element #6
... I hope you see the problem
But more importantly, this is not a decent way to iterate over a collection, so although it's good to understand why it failed, don't try to fix it -- see Nexus post for real solutions!