]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If arc's beam direction is the same as shot direction, snap it, reduces bandwidth...
authorMario <mario@smbclan.net>
Sun, 30 Sep 2018 11:06:52 +0000 (21:06 +1000)
committerMario <mario@smbclan.net>
Sun, 30 Sep 2018 11:07:49 +0000 (21:07 +1000)
qcsrc/common/weapons/weapon/arc.qc

index e78e10a3641d772427a9c053170db903a70e2fb0..c9d12fa679943bc6d84833b9b53db455477d6379 100644 (file)
@@ -322,7 +322,10 @@ void W_Arc_Beam_Think(entity this)
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                min(WEP_CVAR(arc, beam_maxangle) / angle, 1)
                        );
-                       this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
+                       if(vdist(this.beam_dir - w_shotdir, <, 0.01))
+                               this.beam_dir = w_shotdir;
+                       else
+                               this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
                }
                else
                {
@@ -332,7 +335,10 @@ void W_Arc_Beam_Think(entity this)
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                1
                        );
-                       this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
+                       if(vdist(this.beam_dir - w_shotdir, <, 0.01))
+                               this.beam_dir = w_shotdir;
+                       else
+                               this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
                }
 
                // network information: beam direction