diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/shared/particle_parse.cpp | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.tar.xz source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.zip | |
Diffstat (limited to 'mp/src/game/shared/particle_parse.cpp')
| -rw-r--r-- | mp/src/game/shared/particle_parse.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/mp/src/game/shared/particle_parse.cpp b/mp/src/game/shared/particle_parse.cpp index db15685d..28c559e2 100644 --- a/mp/src/game/shared/particle_parse.cpp +++ b/mp/src/game/shared/particle_parse.cpp @@ -567,4 +567,37 @@ void StopParticleEffects( CBaseEntity *pEntity ) } static ConCommand particle_test_stop("particle_test_stop", CC_Particle_Test_Stop, "Stops all particle systems on the selected entities.\n\tArguments: {entity_name} / {class_name} / no argument picks what player is looking at ", FCVAR_CHEAT); -#endif //CLIENT_DLL +#endif //!CLIENT_DLL + +#if defined( CLIENT_DLL ) && defined( STAGING_ONLY ) + + void CC_DispatchParticle( const CCommand& args ) + { + C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer(); + if ( !pLocalPlayer ) + return; + + if ( args.ArgC() < 2 ) + { + DevMsg( "Use: dispatch_particle {particle_name} {surface_offset_distance}\n" ); + return; + } + + float flSurfaceOffsetDistance = 0.f; + if ( args.ArgC() == 3 ) + { + flSurfaceOffsetDistance = atof( args[2] ); + } + + Vector vForward; + pLocalPlayer->GetVectors( &vForward, NULL, NULL ); + trace_t tr; + UTIL_TraceLine( pLocalPlayer->EyePosition(), pLocalPlayer->EyePosition() + vForward * 3000, MASK_SOLID_BRUSHONLY, NULL, &tr ); + + Vector vTargetDeathPos = tr.endpos; + DispatchParticleEffect( args[1], vTargetDeathPos + flSurfaceOffsetDistance * tr.plane.normal, vec3_angle ); + } + + static ConCommand dispatch_particle( "dispatch_particle", CC_DispatchParticle, "Dispatch specified particle effect 50 units away from the lookat surface normal.\n\tArguments: {particle_name} {surface_offset_distance}", FCVAR_CHEAT ); + +#endif // CLIENT_DLL && STAGING_ONLY |