Fix random substitution of particles#24
Conversation
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 for MAX_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 for MAX_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 hitting MAX_PARTICLE_SYSTEMS. Then I discovered a similar unexpected return of reused pointer was also done when MAX_PARTICLES and MAX_PARTICLE_EJECTORS were hit. - Do not return previous particle if MAX_PARTICLES is hit - Do not return previous particle system if MAX_PARTICLE_SYSTEMS is hit - Do not return previous particle ejector if MAX_PARTICLE_EJECTORS is hit This is a port of a patch from Unvanquished: https://unvanquished.net
|
This is a port of a patch from Unvanquished: It fixes a long-standing bug: in servers with many players producing a lot of particles on screen, particles may start to be randomly substituted, like rifle projectiles being on fire, flamer throwing player disconnection bubbles, shotgun emitting jetpack smoke, bullet impact on rock displaying flames, and other unexpected combinations. More detail on the issue is reported on Unvanquished issue tracker: The bug is almost 20 years old, as it was introduced by @timangus in 2003 in commit 51f8195 . Once merged to |
|
Thanks for the fix! It could be a good idea to also submit the patch to the GrangerHub fork of Tremulous if it isn't already fixed there. |
Good idea! Here it is: |
Fix random substitution of particles.
I noticed there was no error message for
MAX_PARTICLE_SYSTEMSbeing hit. I noticed there was an error message forMAX_TRAIL_SYSTEMSbeing 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_SYSTEMShit message and implement it forMAX_PARTICLE_SYSTEMSthe cargo cult way.So I discovered the particle code was not only not printing anything when
MAX_PARTICLE_SYSTEMSwas 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_PARTICLESandMAX_PARTICLE_EJECTORSwere hit.MAX_PARTICLESis hitMAX_PARTICLE_SYSTEMSis hitMAX_PARTICLE_EJECTORSis hitThis is a port of a patch from Unvanquished: https://unvanquished.net