void SP_gfx_light_flare( gentity_t *self ) { self->s.eType = ET_LIGHTFLARE; self->s.modelindex = G_ShaderIndex( self->shaderKey ); VectorCopy( self->activatedPosition, self->s.origin2 ); //try to find a spot near to the flare which is empty. This //is used to facilitate visibility testing findEmptySpot( self->s.origin, 8.0f, self->s.angles2 ); self->act = gfx_light_flare_toggle; if( !self->config.speed ) self->config.speed = 200; self->s.time = self->config.speed; G_SpawnInt( "mindist", "0", &self->s.generic1 ); if ( self->spawnflags & SPF_SPAWN_DISABLED ) { self->s.eFlags |= EF_NODRAW; } trap_LinkEntity( self ); }
/* =============== SP_misc_light_flare Spawn function for light flare =============== */ void SP_misc_light_flare(gentity_t *self) { self->s.eType = ET_LIGHTFLARE; self->s.modelindex = G_ShaderIndex(self->targetShaderName); VectorCopy(self->pos2, self->s.origin2); //try to find a spot near to the flare which is empty. This //is used to facilitate visibility testing findEmptySpot(self->s.origin, 8.0f, self->s.angles2); self->use = SP_use_light_flare; 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; trap_LinkEntity(self); }