]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_tent.c
make lightning come from player's gun
[xonotic/darkplaces.git] / cl_tent.c
index f81fa76ad0209383b1ec38b11a69362cb7f85250..a3e1ed9b6e3a7b6da405ef821aebf31da5fcde9f 100644 (file)
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -486,8 +486,13 @@ void CL_RelinkBeams (void)
                        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.viewentity)
+               //      VectorCopy (cl_entities[cl.viewentity].render.origin, b->start);
+               if (b->entity)
+               {
+                       VectorCopy (cl_entities[b->entity].render.origin, b->start);
+                       b->start[2] += 16;
+               }
 
                // calculate pitch and yaw
                VectorSubtract (b->end, b->start, dist);
@@ -526,6 +531,7 @@ void CL_RelinkBeams (void)
                        ent->render.angles[0] = pitch;
                        ent->render.angles[1] = yaw;
                        ent->render.angles[2] = rand()%360;
+                       CL_BoundingBoxForEntity(&ent->render);
                        VectorMA(org, 30, dist, org);
                        d -= 30;
                }