From 81ee503696d9d5973713afba2afc06b82e41fca8 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 27 Mar 2003 05:33:21 +0000 Subject: * Light flares are now culled based on a new key "mindist" - minimum distance --- src/cgame/cg_ents.c | 4 ++++ src/game/g_misc.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 5c7c6cab..674c758c 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -582,6 +582,10 @@ static void CG_LightFlare( centity_t *cent ) len = VectorLength( delta ); VectorNormalize( delta ); + //flare is too close to camera to be drawn + if( len < es->generic1 ) + return; + //don't bother for flares behind the view plane if( DotProduct( delta, cg.refdef.viewaxis[ 0 ] ) < 0.0 ) return; diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 7004d041..d8055f3a 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -512,6 +512,8 @@ void SP_misc_light_flare( gentity_t *self ) G_SpawnFloat( "speed", "200", &self->speed ); self->s.time = self->speed; + + G_SpawnInt( "mindist", "0", &self->s.generic1 ); if( self->spawnflags & 1 ) self->s.eFlags |= EF_NODRAW; -- cgit