]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hook.qc
#includes: cleanup client
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hook.qc
index ce6ca92b5f4ec0c1b774c32540aefcf7bc10d4fe..6143874e664fdc7331f9fb087c7e134e33c4463e 100644 (file)
@@ -1,12 +1,6 @@
 #include "hook.qh"
-#include "_all.qh"
-
-#include "hud.qh"
-
-#include "../common/teams.qh"
 
 #include "../csqcmodellib/interpolate.qh"
-
 #include "../warpzonelib/common.qh"
 
 entityclass(Hook);
@@ -31,7 +25,7 @@ void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
 }
 
 class(Hook) .float teleport_time;
-void Draw_GrapplingHook()
+void Draw_GrapplingHook(entity this)
 {
        vector a, b, atrans;
        string tex;
@@ -44,7 +38,7 @@ void Draw_GrapplingHook()
        if(self.teleport_time)
        if(time > self.teleport_time)
        {
-               sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard
+               sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); // safeguard
                self.teleport_time = 0;
        }
 
@@ -161,18 +155,18 @@ void Draw_GrapplingHook()
                case ENT_CLIENT_HOOK:
                        break;
                case ENT_CLIENT_ARC_BEAM:
-                       pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
+                       pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
                        break;
        }
 }
 
 void Remove_GrapplingHook()
-{
-       sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
+{SELFPARAM();
+       sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
 }
 
 void Ent_ReadHook(float bIsNew, float type)
-{
+{SELFPARAM();
        self.HookType = type;
 
        int sf = ReadByte();
@@ -224,11 +218,11 @@ void Ent_ReadHook(float bIsNew, float type)
                        default:
                        case ENT_CLIENT_HOOK:
                                // for the model
-                               setmodel(self, "models/hook.md3");
+                               setmodel(self, MDL_HOOK);
                                self.drawmask = MASK_NORMAL;
                                break;
                        case ENT_CLIENT_ARC_BEAM:
-                               sound (self, CH_SHOTS_SINGLE, W_Sound("lgbeam_fly"), VOL_BASE, ATTEN_NORM);
+                               sound (self, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM);
                                break;
                }
        }
@@ -236,10 +230,4 @@ void Ent_ReadHook(float bIsNew, float type)
        self.teleport_time = time + 10;
 }
 
-void Hook_Precache()
-{
-       precache_sound(W_Sound("lgbeam_fly"));
-       precache_model("models/hook.md3");
-}
-
 // TODO: hook: temporarily transform self.origin for drawing the model along warpzones!