diff options
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r-- | src/cgame/cg_buildable.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 38259dc6..1daaf464 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -108,9 +108,13 @@ void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir ) //particle system ps = CG_SpawnNewParticleSystem( cgs.media.alienBuildableDestroyedPS ); - CG_SetParticleSystemOrigin( ps, origin ); - CG_SetParticleSystemNormal( ps, dir ); - CG_AttachParticleSystemToOrigin( ps ); + + if( CG_IsParticleSystemValid( &ps ) ) + { + CG_SetAttachmentPoint( &ps->attachment, origin ); + CG_SetParticleSystemNormal( ps, dir ); + CG_AttachToPoint( &ps->attachment ); + } } @@ -205,9 +209,13 @@ void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir ) //particle system ps = CG_SpawnNewParticleSystem( cgs.media.humanBuildableDestroyedPS ); - CG_SetParticleSystemOrigin( ps, origin ); - CG_SetParticleSystemNormal( ps, dir ); - CG_AttachParticleSystemToOrigin( ps ); + + if( CG_IsParticleSystemValid( &ps ) ) + { + CG_SetAttachmentPoint( &ps->attachment, origin ); + CG_SetParticleSystemNormal( ps, dir ); + CG_AttachToPoint( &ps->attachment ); + } } @@ -500,6 +508,8 @@ void CG_InitBuildables( ) cg.buildablesFraction = (float)i / (float)( BA_NUM_BUILDABLES - 1 ); trap_UpdateScreen( ); } + + cgs.media.teslaZapTS = CG_RegisterTrailSystem( "models/buildables/tesla/zap" ); } /* @@ -823,8 +833,12 @@ static void CG_BuildableParticleEffects( centity_t *cent ) if( healthFrac < 0.33f && !CG_IsParticleSystemValid( ¢->buildablePS ) ) { cent->buildablePS = CG_SpawnNewParticleSystem( cgs.media.humanBuildableDamagedPS ); - CG_SetParticleSystemCent( cent->buildablePS, cent ); - CG_AttachParticleSystemToCent( cent->buildablePS ); + + if( CG_IsParticleSystemValid( ¢->buildablePS ) ) + { + CG_SetAttachmentCent( ¢->buildablePS->attachment, cent ); + CG_AttachToCent( ¢->buildablePS->attachment ); + } } else if( healthFrac >= 0.33f && CG_IsParticleSystemValid( ¢->buildablePS ) ) CG_DestroyParticleSystem( ¢->buildablePS ); @@ -834,9 +848,13 @@ static void CG_BuildableParticleEffects( centity_t *cent ) if( healthFrac < 0.33f && !CG_IsParticleSystemValid( ¢->buildablePS ) ) { cent->buildablePS = CG_SpawnNewParticleSystem( cgs.media.alienBuildableDamagedPS ); - CG_SetParticleSystemCent( cent->buildablePS, cent ); - CG_SetParticleSystemNormal( cent->buildablePS, es->origin2 ); - CG_AttachParticleSystemToCent( cent->buildablePS ); + + if( CG_IsParticleSystemValid( ¢->buildablePS ) ) + { + CG_SetAttachmentCent( ¢->buildablePS->attachment, cent ); + CG_SetParticleSystemNormal( cent->buildablePS, es->origin2 ); + CG_AttachToCent( ¢->buildablePS->attachment ); + } } else if( healthFrac >= 0.33f && CG_IsParticleSystemValid( ¢->buildablePS ) ) CG_DestroyParticleSystem( ¢->buildablePS ); |