]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_hook.qc
Impulses: migration pathway
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index ec66994280b9874c70af8ddd3cbcfc5e89e76671..360078d2a31124fde23eb212159440944d802649 100644 (file)
@@ -1,7 +1,7 @@
 #include "g_hook.qh"
-#include "_all.qh"
 
 #include "weapons/common.qh"
+#include "weapons/csqcprojectile.qh"
 #include "weapons/weaponsystem.qh"
 #include "weapons/selection.qh"
 #include "weapons/tracing.qh"
 #include "../common/constants.qh"
 #include "../common/util.qh"
 #include "../common/weapons/all.qh"
-#include "../warpzonelib/common.qh"
-#include "../warpzonelib/server.qh"
+#include "../lib/warpzone/common.qh"
+#include "../lib/warpzone/server.qh"
+
+.int state;
 
 /*============================================
 
@@ -78,12 +80,12 @@ void RemoveGrapplingHook(entity pl)
        //pl.disableclientprediction = false;
 }
 
-void GrapplingHookReset(void)
-{SELFPARAM();
-       if(self.realowner.hook == self)
-               RemoveGrapplingHook(self.owner);
+void GrapplingHookReset(entity this)
+{
+       if(this.realowner.hook == this)
+               RemoveGrapplingHook(this.owner);
        else // in any case:
-               remove(self);
+               remove(this);
 }
 
 void GrapplingHookThink();
@@ -104,7 +106,7 @@ void GrapplingHook_Stop()
 .vector hook_start, hook_end;
 bool GrapplingHookSend(entity this, entity to, int sf)
 {
-       WriteByte(MSG_ENTITY, ENT_CLIENT_HOOK);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_HOOK);
        sf = sf & 0x7F;
        if(sound_allowed(MSG_BROADCAST, self.realowner))
                sf |= 0x80;
@@ -149,10 +151,7 @@ void GrapplingHookThink()
 
        self.nextthink = time;
 
-       int s = self.realowner.cvar_cl_gunalign;
-       if(s != 1 && s != 2 && s != 4)
-               s = 3; // default value
-       --s;
+       int s = W_GetGunAlignment(self.realowner);
        vs = hook_shotorigin[s];
 
        makevectors(self.realowner.v_angle);
@@ -300,7 +299,7 @@ void GrapplingHookThink()
        }
 }
 
-void GrapplingHookTouch (void)
+void GrapplingHookTouch ()
 {SELFPARAM();
        if(other.movetype == MOVETYPE_FOLLOW)
                return;
@@ -340,7 +339,7 @@ void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, int
        }
 }
 
-void FireGrapplingHook (void)
+void FireGrapplingHook ()
 {SELFPARAM();
        entity missile;
        vector org;
@@ -351,10 +350,7 @@ void FireGrapplingHook (void)
 
        makevectors(self.v_angle);
 
-       int s = self.cvar_cl_gunalign;
-       if(s != 1 && s != 2 && s != 4)
-               s = 3; // default value
-       --s;
+       int s = W_GetGunAlignment(self);
        vs = hook_shotorigin[s];
 
        // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds