↧
Answer by TehJustice
Haven't dissected the code yet to see if this is the issue, but you should never remove an object in the middle of the foreach loop.
View ArticleAnswer by Cherno
If you want to iterate through a collection and modify it while doing so (such as removing or adding items), don't use a foreach loop. Use a normal for... loop, but do it in reverse like this, and you...
View Article