From 7a2ac4a9c0bb7d0c014e4a07dd2fdaee42f614bd Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 8 Sep 2022 04:15:09 +0300 Subject: [PATCH] engine: client: use generic particles code for blob particles (from tempentity code) only if Quake compatibility was enabled --- engine/client/cl_efx.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_efx.c b/engine/client/cl_efx.c index d7ad1196..6a07dd49 100644 --- a/engine/client/cl_efx.c +++ b/engine/client/cl_efx.c @@ -1111,9 +1111,13 @@ R_ParticleExplosion2 void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength ) { int i, j; - int colorMod = 0; + int colorMod = 0, packedColor; particle_t *p; + if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE )) + packedColor = 255; // use old code for blob particles + else packedColor = 0; + for( i = 0; i < 512; i++ ) { p = R_AllocParticle( NULL ); @@ -1121,7 +1125,7 @@ void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int col p->die = cl.time + 0.3f; p->color = colorStart + ( colorMod % colorLength ); - p->packedColor = 255; // use old code for blob particles + p->packedColor = packedColor; colorMod++; p->type = pt_blob; @@ -1143,15 +1147,19 @@ R_BlobExplosion void GAME_EXPORT R_BlobExplosion( const vec3_t org ) { particle_t *p; - int i, j; + int i, j, packedColor; + + if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE )) + packedColor = 255; // use old code for blob particles + else packedColor = 0; for( i = 0; i < 1024; i++ ) { p = R_AllocParticle( NULL ); if( !p ) return; - p->die = cl.time + COM_RandomFloat( 2.0f, 2.4f ); - p->packedColor = 255; // use old code for blob particles + p->die = cl.time + COM_RandomFloat( 1.0f, 1.4f ); + p->packedColor = packedColor; if( i & 1 ) {