]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hook.qc
Use the function in client code too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hook.qc
index 8436ff6225a0ccc0e546bf5007fccec05720c394..3da79866d874a4926033db89cd349562d6566a99 100644 (file)
@@ -1,12 +1,22 @@
+#include "hook.qh"
+#include "_all.qh"
+
 #include "hud.qh"
 #include "noise.qh"
+
+#include "../common/teams.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
 #include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
 
-.float HookType; // ENT_CLIENT_*
-.vector origin;
-.vector velocity;
-.float HookSilent;
-.float HookRange;
+entityclass(Hook);
+class(Hook) .float HookType; // ENT_CLIENT_*
+class(Hook) .vector origin;
+class(Hook) .vector velocity;
+class(Hook) .float HookSilent;
+class(Hook) .float HookRange;
 
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
 {
@@ -49,7 +59,7 @@ void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
        Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
 }
 
-.float teleport_time;
+class(Hook) .float teleport_time;
 void Draw_GrapplingHook()
 {
        vector a, b, atrans;
@@ -247,7 +257,7 @@ void Ent_ReadHook(float bIsNew, float type)
                                self.drawmask = MASK_NORMAL;
                                break;
                        case ENT_CLIENT_ARC_BEAM:
-                               sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
+                               sound (self, CH_SHOTS_SINGLE, W_Sound("lgbeam_fly"), VOL_BASE, ATTEN_NORM);
                                break;
                }
        }
@@ -257,7 +267,7 @@ void Ent_ReadHook(float bIsNew, float type)
 
 void Hook_Precache()
 {
-       precache_sound("weapons/lgbeam_fly.wav");
+       precache_sound(W_Sound("lgbeam_fly"));
        precache_model("models/hook.md3");
 }