Well, I thought I had fixed that damn bug, and for awhile, it seemed that I did, but it would seem all I did was make it happen less often. While the bug has been gone from my computer since yesterday night, I found it was crashing often on the school computers I was using today, so I had to sit down and look at the code for hours, and I may have found the problem(or one of them [grin])
The Bug (prehaps)
Well, all the objects in A22 are stored in a STL vector(yes I know, lists are better for insertion/deletion, blah blah blah[wink]) Anyways, whenever an object's readytodie variable is set to true, the engine deletes the allocated memory, and removes the object via the erase() function, as seen below:
for(int i = 0; i < activeobjects.size(); i++)
activeobjects.erase(activeobjects.begin() + i);
Well, to my understanding, when using the erase() function, all the object stored past the removed object have their index's moved down by one, and the vector is resized. Anyways, what I think is happening(correct me if this makes no sense, I don't claim to be an STL expert...) Is that when an object is deleted, all they other objects move down to fill in that slot, but the index ("i") remains pointing at the same "slot" in the vector, which has been filled by a new object, but when the for loop "loops", the index is incremented, and that object's removal check is skipped over, resulting in an error... for some reason. So now whenever something is erased, I decrement the index by one, and set it to the new objects index. I'm really stretching here, but it seems to be working for other computers now, so maybe that was it, but who's to know? Anyways, if anyone sees a flaw in my logic, let me know, because I'm pretty clueless when it comes to this stuff.
As you may have read in Mark's journal, we both started our last year of high school this Wednesday, and as such, we both will be having less time to work on Angels 22. OTOH, we have a "gifted" computer class we're both in, so we'll be able to work together in there, which should help out alot.
Angels 22 Demo
Okay, here's a new, hopefully more bugless, version of Angels 22. Nothing has been added, but hopefully it won't crash as much anymore, so if anyone who has been having problems with it could try it out, and see if it still crashes, or shows those wierd grey overlays, that would be great.
Angels 22 *fixed-ish*
Well, hopefully I'll have a screeny of some new stuff soon, Mark and I have been planning some missions out, so once we have one of those finished, we should be able to show you guys how the actual missions will play (the current demo has a fraction of the total gameplay we have so far). Anyways, thanks for reading, Peace Out!