Narks
Vastly intelligent whale-like being from the stars
- Reaction score
- 90
For example: A projectile is added to a group when it comes near a unit, then it is recycled and used again, once again it comes near the same unit, but it is already in the group this time, so it doesn't work properly.
How does anyone propose I fix that problem.
Well, maybe you should make your own "ProjectileGroup" struct? That way, projectiles can automatically be removed from the group when they collide with something (or maybe remove them from the group when you enumerate through the group, for efficiency), thus preventing lots of fun from happening.