From 661befa990f017189ad1a05b7bdcb66320045ac7 Mon Sep 17 00:00:00 2001 From: SNMetamorph Date: Sun, 5 Jan 2025 19:46:50 +0400 Subject: [PATCH] client: render: backported minor changes in Aurora particles from XashXT --- client/render/gl_aurora.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/render/gl_aurora.cpp b/client/render/gl_aurora.cpp index 98ba0b43..dc8c1342 100644 --- a/client/render/gl_aurora.cpp +++ b/client/render/gl_aurora.cpp @@ -25,7 +25,7 @@ void UTIL_CreateAurora( cl_entity_t *ent, const char *file, int attachment, floa // verify file exists // g-cont. idea! use COMPARE_FILE_TIME instead of LOAD_FILE - if( COMPARE_FILE_TIME( file, file, &iCompare )) + if( !g_fRenderInitialized || COMPARE_FILE_TIME( file, file, &iCompare )) { CParticleSystem *pSystem = new CParticleSystem( ent, file, attachment, lifetime ); g_pParticleSystems.AddSystem( pSystem ); @@ -823,10 +823,10 @@ AURSTATE CParticleSystem :: UpdateSystem( float frametime ) // check for contents to remove if( m_iKillCondition == POINT_CONTENTS( m_pEntity->origin )) - { + { m_pEntity = NULL; - enable = false; - } + enable = false; + } } else { @@ -1047,6 +1047,10 @@ bool CParticleSystem :: UpdateParticle( CParticle *part, float frametime ) part->m_fBlue += part->m_fBlueStep * frametime; part->frame += part->m_fFrameStep * frametime; + if (!part->m_pEntity && (part->m_fSize <= 0.0f || part->m_fAlpha <= 0.0f)) { + return false; + } + if( part->m_fAngleStep ) { part->m_fAngle += part->m_fAngleStep * frametime;