fix some draw issues with the hook
authorRudolf Polzer <divverent@alientrap.org>
Sat, 30 Oct 2010 19:21:51 +0000 (21:21 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 30 Oct 2010 19:21:51 +0000 (21:21 +0200)
qcsrc/client/hook.qc
qcsrc/server/g_hook.qc

index cb2d7f3..a995970 100644 (file)
@@ -189,8 +189,16 @@ void Draw_GrapplingHook()
        {
                default:
                case ENT_CLIENT_HOOK:
-                       setorigin(self, trace_endpos); // hook endpoint!
-                       self.angles = vectoangles(trace_endpos - atrans);
+                       if(vlen(trace_endpos - atrans) > 0.5)
+                       {
+                               setorigin(self, trace_endpos); // hook endpoint!
+                               self.angles = vectoangles(trace_endpos - atrans);
+                               self.drawmask = MASK_NORMAL;
+                       }
+                       else
+                       {
+                               self.drawmask = 0;
+                       }
                        break;
                case ENT_CLIENT_LGBEAM:
                case ENT_CLIENT_GAUNTLET:
index ce3d9b7..b5eb282 100644 (file)
@@ -268,7 +268,7 @@ void GrapplingHookThink()
        }
 
        makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
-       myorg = WarpZone_RefSys_TransformOrigin(self, self.owner, self.origin) + v_forward * (-9);
+       myorg = WarpZone_RefSys_TransformOrigin(self, self.owner, self.origin); // + v_forward * (-9);
 
        if(myorg != self.hook_start)
        {