What a waste of a day.
Somehow, i end up losing somewhere around 6-8 hours of work time to what is possibly the top 5 most ludicrous bugs i've ever dealt with in my programming career.
For months now, we have had a stable level 1-1. Suddenly, a line of code that does objective checking on our trigger system (kill enemies 4,5,6 drops a chest, that sort of thing) stops working. The line that's the culprit?
var tempArray : Array = new Array(gObjectiveList);
for those of you not verse in programming, all this is doing is essentially making a copy of an existing array. The array wasn't empty, or null, or changed in any way. It's the same old array we'd been copying for months with no issue. In fact, the Web/Mac/PC Builds don't even give off an error. Only iOS, and only in ONE spot where this line was called. This type of initaliziation is called in our code maybe 20 times in different situations.
The solution? Do the exact same thing, but in a different way:
- var tempArray : Array;
- for (all objects in gObjectiveList) tempArray.Add(gObjectiveList[i]);
insane. time poorly spent. Now i wish i knew who to blame.