don't send the effect number for infinite non-collisiontesting lasers
authorRudolf Polzer <divverent@alientrap.org>
Sun, 17 Oct 2010 20:02:53 +0000 (22:02 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 17 Oct 2010 20:02:53 +0000 (22:02 +0200)
qcsrc/client/laser.qc
qcsrc/server/g_triggers.qc

index 32119283e937833e4a10d2cd817c5a32b4299e8c..9bc5dce9d9f6c75a8b4929547eedef1a34ac8ef9 100644 (file)
@@ -101,7 +101,10 @@ void Ent_Laser()
                        self.scale *= ReadByte() / 16.0; // beam radius
                        self.modelscale *= ReadByte() / 16.0; // dlight radius
                }
-               self.cnt = ReadShort() - 1; // effect number
+               if((f & 0x80) || !(f & 0x10))
+                       self.cnt = ReadShort() - 1; // effect number
+               else
+                       self.cnt = 0;
        }
        if(f & 2)
        {
index d627cd86e85ec242d12b6bd2c4f0a861f89b0cb6..d97413f10efb94ff15770a6faf4b5af981d0aeb0 100644 (file)
@@ -1104,7 +1104,8 @@ float laser_SendEntity(entity to, float fl)
                        WriteByte(MSG_ENTITY, bound(0, self.scale * 16.0, 255));
                        WriteByte(MSG_ENTITY, bound(0, self.modelscale * 16.0, 255));
                }
-               WriteShort(MSG_ENTITY, self.cnt + 1);
+               if((fl & 0x80) || !(fl & 0x10)) // effect doesn't need sending if the laser is infinite and has collision testing turned off
+                       WriteShort(MSG_ENTITY, self.cnt + 1);
        }
        if(fl & 2)
        {