moai/moai-dev — pull request #910 by seebs (2014-04-28 23:42:35+00:00)
Title: MOAIParticleSystem.cpp: Even when wrapping, respect size of sprite array...

....

When using wrapping with the particle system, GetTopSprite() could return
a pointer to a sprite outside the actual reserved array, because it
always returned the address of the Nth item in the array, even if the
array didn't have that many items. Add a % operator to parallel the
usage for computing the index in PushSprite().

PushParticle() doesn't have a corresponding problem, because it doesn't
use the array as an array, but rather maintains a free list of available
particles.