]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/arc.qc
Set gun alignment on the server (hopefully more reliable)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / arc.qc
index 06d784af20a1c66342358bca2bae1ec5496ba8d5..6f8b6691ab11e52d53f4ff9d2a1b76d6349b913c 100644 (file)
@@ -1304,17 +1304,9 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
 
        if(isnew)
        {
-               int gunalign = W_GunAlign(NULL, STAT(GUNALIGN));
+               int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN));
 
-               this.beam_shotorigin = arc_shotorigin[gunalign]; // quick
-               for(int j = 1; j < 5; ++j)
-               {
-                       if(gunaligns[j] == viewmodels[slot])
-                       {
-                               this.beam_shotorigin = arc_shotorigin[j - 1]; // accurate
-                               break;
-                       }
-               }
+               this.beam_shotorigin = arc_shotorigin[gunalign];
 
                // set other main attributes of the beam
                this.draw = Draw_ArcBeam;