]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hook.qc
fix electro beam drawing through warpzone
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hook.qc
index 412d4a44e02890c3e46e830f8430c9c2671563a9..06858d597aa917a126e1e46cc50354458973afa0 100644 (file)
@@ -5,7 +5,7 @@
 .float HookSilent;
 .float HookRange;
 
-void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag)
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag, vector vieworg)
 {
        // I want to draw a quad...
        // from and to are MIDPOINTS.
@@ -17,7 +17,7 @@ void Draw_CylindricLine(vector from, vector to, float thickness, string texture,
        length_tex = aspect * vlen(to - from) / thickness;
 
        // direction is perpendicular to the view normal, and perpendicular to the axis
-       thickdir = normalize(cross(axis, view_origin - from));
+       thickdir = normalize(cross(axis, vieworg - from));
 
 /*
        print("from ", vtos(from), "\n");
@@ -46,8 +46,10 @@ float Draw_GrapplingHook_trace_callback_a;
 void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
 {
        float i;
+       vector vorg;
+       vorg = WarpZone_TransformOrigin(WarpZone_trace_transform, view_origin);
        for(i = 0; i < Draw_GrapplingHook_trace_callback_a; ++i)
-               Draw_CylindricLine(hit, start, 8, Draw_GrapplingHook_trace_callback_tex, 0.25, Draw_GrapplingHook_trace_callback_rnd, Draw_GrapplingHook_trace_callback_rgb, min(1, Draw_GrapplingHook_trace_callback_a - i), DRAWFLAG_NORMAL);
+               Draw_CylindricLine(hit, start, 8, Draw_GrapplingHook_trace_callback_tex, 0.25, Draw_GrapplingHook_trace_callback_rnd, Draw_GrapplingHook_trace_callback_rgb, min(1, Draw_GrapplingHook_trace_callback_a - i), DRAWFLAG_NORMAL, vorg);
        Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
 }
 
@@ -126,7 +128,7 @@ void Draw_GrapplingHook()
                default:
                case ENT_CLIENT_HOOK:
                        intensity = 1;
-                       offset = Noise_White(self, frametime);
+                       offset = 0;
                        if(t == COLOR_TEAM1)
                        {
                                tex = "particles/hook_red";