properly draw the hook through warpzones again too; fix interpolation issues
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_laser.qc
index dd5e30e..abf1a39 100644 (file)
@@ -131,6 +131,7 @@ float gauntletbeam_send(entity to, float sf)
 .float prevgauntletfire;
 void gauntletbeam_think()
 {
+       vector endpos;
        float damage, myforce, myradius;
        if(self.cnt)
        {
@@ -157,8 +158,19 @@ void gauntletbeam_think()
        makevectors(self.owner.v_angle);
        vector angle;
        angle = v_forward;
-
+       // get effect origin
+       vector vecs, org;
+       if(self.owner.weaponentity.movedir_x > 0)
+               vecs = self.owner.weaponentity.movedir;
+       else
+               vecs = '0 0 0';
+       if(debug_shotorg != '0 0 0')
+               vecs = debug_shotorg;
+       org = self.owner.origin + self.owner.view_ofs + v_forward * vecs_x + v_right * -vecs_y + v_up * vecs_z;
+       
        WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * myradius, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
+       endpos = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+       WarpZone_traceline_antilag(self.owner, org, endpos, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
 
        // apply the damage
        if(trace_fraction < 1)
@@ -169,25 +181,15 @@ void gauntletbeam_think()
        }
 
        // draw effect
-       vector vecs, org;
-       if(self.owner.weaponentity.movedir_x > 0)
-       {
-               vecs = self.owner.weaponentity.movedir;
-               vecs_y = -vecs_y;
-       }
-       else
-               vecs = '0 0 0';
-       org = self.owner.origin + self.owner.view_ofs + v_forward * vecs_x + v_right * vecs_y + v_up * vecs_z;
-       
        if(org != self.hook_start)
        {
                self.SendFlags |= 2;
                self.hook_start = org;
        }
-       if(trace_endpos != self.hook_end)
+       if(endpos != self.hook_end)
        {
                self.SendFlags |= 4;
-               self.hook_end = trace_endpos;
+               self.hook_end = endpos;
        }
 }