Euflorium: The Eufloria Community
Eufloria => Eufloria Classic => Eufloria Classic Support => Topic started by: elideb on May 17, 2011, 07:34:40 AM
-
When calling Asteroid:RemoveSeedlings (int faction, int number), the most frequent result is a game crash. If the command is invoked from console, the crash does not happen, and the output is:
"Index was out of range. Must be non-negative and less than the size of the collection."
The error does not happen if the number of seedlings to remove is 0 or there are 0 seedlings of the faction in the asteroid.
The attachment is a small test level. Move the RemoveSeedlings calls around to check different results.
-
I've had this issue before and I came to the conclusion that destroying seedlings is not instantaneous. I.E, a seedling in the process of being destroyed still counts as a seedling. Sometimes you're code will try and delete the same seedling twice and that's what causes the crash. Adding a time delay between subsequent removes fixes this (iirc).