make lightning come from player's gun
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 18 Sep 2002 04:51:59 +0000 (04:51 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 18 Sep 2002 04:51:59 +0000 (04:51 +0000)
fix lightning visibility (wasn't calculating bounding box before)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2389 d7cf8633-e32d-0410-b094-e92efae38249

cl_tent.c

index f81fa76..a3e1ed9 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;
                }