Browse Source

game/server: fix particle transition from trigger_vphysics_motion

pull/133/head
nillerusr 2 years ago
parent
commit
ba90de20d9
  1. 3
      game/server/triggers.cpp
  2. 1
      game/shared/baseparticleentity.cpp
  3. 12
      game/shared/baseparticleentity.h

3
game/server/triggers.cpp

@ -4623,7 +4623,8 @@ void CTriggerVPhysicsMotion::StartTouch( CBaseEntity *pOther )
#ifndef _XBOX #ifndef _XBOX
if ( m_ParticleTrail.m_strMaterialName != NULL_STRING ) if ( m_ParticleTrail.m_strMaterialName != NULL_STRING )
{ {
CEntityParticleTrail::Create( pOther, m_ParticleTrail, this ); CEntityParticleTrail *pTrail = CEntityParticleTrail::Create( pOther, m_ParticleTrail, this );
pTrail->SetShouldDeletedOnChangelevel( true );
} }
#endif #endif

1
game/shared/baseparticleentity.cpp

@ -35,6 +35,7 @@ CBaseParticleEntity::CBaseParticleEntity( void )
m_bSimulate = true; m_bSimulate = true;
m_nToolParticleEffectId = TOOLPARTICLESYSTEMID_INVALID; m_nToolParticleEffectId = TOOLPARTICLESYSTEMID_INVALID;
#endif #endif
m_bShouldDeletedOnChangelevel = false;
} }
CBaseParticleEntity::~CBaseParticleEntity( void ) CBaseParticleEntity::~CBaseParticleEntity( void )

12
game/shared/baseparticleentity.h

@ -35,6 +35,16 @@ public:
CBaseParticleEntity(); CBaseParticleEntity();
virtual ~CBaseParticleEntity(); virtual ~CBaseParticleEntity();
virtual int ObjectCaps()
{
if( m_bShouldDeletedOnChangelevel )
return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
else
return BaseClass::ObjectCaps();
}
void SetShouldDeletedOnChangelevel( bool bDel ) { m_bShouldDeletedOnChangelevel = bDel; }
// CBaseEntity overrides. // CBaseEntity overrides.
public: public:
#if !defined( CLIENT_DLL ) #if !defined( CLIENT_DLL )
@ -76,6 +86,8 @@ public:
void SetLifetime(float lifetime); void SetLifetime(float lifetime);
private: private:
bool m_bShouldDeletedOnChangelevel;
CBaseParticleEntity( const CBaseParticleEntity & ); // not defined, not accessible CBaseParticleEntity( const CBaseParticleEntity & ); // not defined, not accessible
}; };

Loading…
Cancel
Save