misc_laser: add a spawn flag to disable collision testing of the laser (laser then...
authorRudolf Polzer <divverent@alientrap.org>
Sun, 17 Oct 2010 19:59:02 +0000 (21:59 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 17 Oct 2010 19:59:02 +0000 (21:59 +0200)
qcsrc/client/laser.qc
qcsrc/server/g_triggers.qc

index 6703b1b11f82ad1b96d7e387d33b36d2b44b7996..32119283e937833e4a10d2cd817c5a32b4299e8c 100644 (file)
@@ -22,14 +22,28 @@ void Draw_Laser()
        InterpolateOrigin_Do();
        if(self.count & 0x80)
        {
-               traceline(self.origin, self.velocity, 0, self);
+               if(self.count & 0x10)
+               {
+                       trace_endpos = self.velocity,
+                       trace_dphitq3surfaceflags = 0;
+               }
+               else
+                       traceline(self.origin, self.velocity, 0, self);
        }
        else
        {
-               makevectors(self.angles);
-               traceline(self.origin, self.origin + v_forward * 32768, 0, self);
-               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+               if(self.count & 0x10)
+               {
                        trace_endpos = self.origin + v_forward * 1048576;
+                       trace_dphitq3surfaceflags = Q3SURFACEFLAG_SKY;
+               }
+               else
+               {
+                       makevectors(self.angles);
+                       traceline(self.origin, self.origin + v_forward * 32768, 0, self);
+                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+                               trace_endpos = self.origin + v_forward * 1048576;
+               }
        }
        if(self.scale != 0)
        {
@@ -58,7 +72,7 @@ void Ent_Laser()
 
        // 30 bytes, or 13 bytes for just moving
        f = ReadByte();
-       self.count = (f & 0xE0);
+       self.count = (f & 0xF0);
 
        if(self.count & 0x80)
                self.iflags = IFLAG_VELOCITY;
index 1f50a1b818099fdceccc925e5d33a23976b52eea..d627cd86e85ec242d12b6bd2c4f0a861f89b0cb6 100644 (file)
@@ -1076,13 +1076,15 @@ void misc_laser_think()
 float laser_SendEntity(entity to, float fl)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_LASER);
-       fl = fl - (fl & 0xE0); // use that bit to indicate finite length laser
+       fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
        if(self.spawnflags & 2)
                fl |= 0x80;
        if(self.alpha)
                fl |= 0x40;
        if(self.scale != 1 || self.modelscale != 1)
                fl |= 0x20;
+       if(self.spawnflags & 4)
+               fl |= 0x10;
        WriteByte(MSG_ENTITY, fl);
        if(fl & 1)
        {