+ }
+
+ if (intframe != e->frame)
+ {
+ e->frame = intframe;
+ e->frame1time = e->frame2time;
+ e->frame2time = cl.time;
+ }
+
+ // if we're drawing effects, get a new temp entity
+ // (NewTempEntity adds it to the render entities list for us)
+ if (r_draweffects.integer && (ent = CL_NewTempEntity()))
+ {
+ // interpolation stuff
+ ent->render.frame1 = intframe;
+ ent->render.frame2 = intframe + 1;
+ if (ent->render.frame2 >= e->endframe)
+ ent->render.frame2 = -1; // disappear
+ ent->render.framelerp = frame - intframe;
+ ent->render.frame1time = e->frame1time;
+ ent->render.frame2time = e->frame2time;
+
+ // normal stuff
+ VectorCopy(e->origin, ent->render.origin);
+ ent->render.model = cl.model_precache[e->modelindex];
+ ent->render.frame = ent->render.frame2;
+ ent->render.colormap = -1; // no special coloring
+ ent->render.scale = 1;
+ ent->render.alpha = 1;
+
+ CL_BoundingBoxForEntity(&ent->render);
+ }
+ }
+ }
+}
+
+void CL_RelinkBeams (void)
+{
+ int i;
+ beam_t *b;
+ vec3_t dist, org;
+ float d;
+ entity_t *ent;
+ float yaw, pitch;
+ float forward;
+
+ for (i = 0, b = cl_beams;i < cl_max_beams;i++, b++)
+ {
+ if (!b->model || b->endtime < cl.time)
+ continue;
+
+ // if coming from the player, update the start position
+ //if (b->entity == cl.viewentity)
+ // VectorCopy (cl_entities[cl.viewentity].render.origin, b->start);
+ if (b->entity && cl_entities[b->entity].state_current.active)
+ {
+ VectorCopy (cl_entities[b->entity].render.origin, b->start);
+ b->start[2] += 16;
+ }
+
+ // calculate pitch and yaw
+ VectorSubtract (b->end, b->start, dist);
+
+ if (dist[1] == 0 && dist[0] == 0)
+ {
+ yaw = 0;
+ if (dist[2] > 0)
+ pitch = 90;
+ else
+ pitch = 270;