Fix random substitution of particles #24
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix random substitution of particles.
I noticed there was no error message for
MAX_PARTICLE_SYSTEMS
being hit. I noticed there was an error message forMAX_TRAIL_SYSTEMS
being hit.So I wanted to add such error message to debug the random substitution of particles.
So I decided to copy-paste the
MAX_TRAIL_SYSTEMS
hit message and implement it forMAX_PARTICLE_SYSTEMS
the cargo cult way.So I discovered the particle code was not only not printing anything when
MAX_PARTICLE_SYSTEMS
was hit, but was also returning the particle system anyway, the previous one before hittingMAX_PARTICLE_SYSTEMS
.Then I discovered a similar unexpected return of reused pointer was also done when
MAX_PARTICLES
andMAX_PARTICLE_EJECTORS
were hit.MAX_PARTICLES
is hitMAX_PARTICLE_SYSTEMS
is hitMAX_PARTICLE_EJECTORS
is hitThis is a port of a patch from Unvanquished: https://unvanquished.net