+ // LordHavoc: customizable trail
+ if (ent->render.flags & RENDER_GLOWTRAIL)
+ CL_RocketTrail2 (oldorg, neworg, ent->state_current.glowcolor, ent);
+
+ if (dlightcolor[0] || dlightcolor[1] || dlightcolor[2])
+ {
+ VectorCopy(neworg, v);
+ // hack to make glowing player light shine on their gun
+ if (i == cl.viewentity/* && !chase_active.integer*/)
+ v[2] += 30;
+ CL_AllocDlight (&ent->render, v, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0);
+ }
+
+ if (chase_active.integer && (ent->render.flags & RENDER_VIEWMODEL))
+ continue;
+
+ // don't show entities with no modelindex (note: this still shows
+ // entities which have a modelindex that resolved to a NULL model)
+ if (!ent->state_current.modelindex)
+ continue;
+ if (effects & EF_NODRAW)
+ continue;
+
+ CL_BoundingBoxForEntity(&ent->render);
+ if (ent->render.model && ent->render.model->name[0] == '*' && ent->render.model->type == mod_brush)
+ cl_brushmodel_entities[cl_num_brushmodel_entities++] = &ent->render;
+
+ if (r_refdef.numentities < r_refdef.maxentities)
+ r_refdef.entities[r_refdef.numentities++] = &ent->render;
+
+ if (cl_num_entities < i + 1)
+ cl_num_entities = i + 1;
+ }
+}
+
+void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate)
+{
+ int i;
+ cl_effect_t *e;
+ if (!modelindex) // sanity check
+ return;
+ for (i = 0, e = cl_effects;i < cl_max_effects;i++, e++)
+ {
+ if (e->active)
+ continue;
+ e->active = true;
+ VectorCopy(org, e->origin);
+ e->modelindex = modelindex;
+ e->starttime = cl.time;
+ e->startframe = startframe;
+ e->endframe = startframe + framecount;
+ e->framerate = framerate;
+
+ e->frame = 0;
+ e->frame1time = cl.time;
+ e->frame2time = cl.time;
+ break;
+ }
+}
+
+static void CL_RelinkEffects(void)
+{
+ int i, intframe;
+ cl_effect_t *e;
+ entity_t *ent;
+ float frame;