]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_hook.qc
Merge branch 'terencehill/dynamic_hud' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index c0509a3f69b0d5d8386f7d32a218882980618286..1b5e22bee56ed4e0ccd44c6f86847be5f46557b9 100644 (file)
@@ -8,6 +8,8 @@
 #include "cl_player.qh"
 #include "command/common.qh"
 #include "round_handler.qh"
+#include "../common/state.qh"
+#include "../common/physics/player.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/constants.qh"
 #include "../common/util.qh"
@@ -88,16 +90,16 @@ void GrapplingHookReset(entity this)
                remove(this);
 }
 
-void GrapplingHookThink();
+void GrapplingHookThink(entity this);
 void GrapplingHook_Stop()
 {SELFPARAM();
        Send_Effect(EFFECT_HOOK_IMPACT, self.origin, '0 0 0', 1);
        sound (self, CH_SHOTS, SND_HOOK_IMPACT, VOL_BASE, ATTEN_NORM);
 
        self.state = 1;
-       self.think = GrapplingHookThink;
+       setthink(self, GrapplingHookThink);
        self.nextthink = time;
-       self.touch = func_null;
+       settouch(self, func_null);
        self.velocity = '0 0 0';
        self.movetype = MOVETYPE_NONE;
        self.hook_length = -1;
@@ -132,8 +134,8 @@ bool GrapplingHookSend(entity this, entity to, int sf)
 
 int autocvar_g_grappling_hook_tarzan;
 
-void GrapplingHookThink()
-{SELFPARAM();
+void GrapplingHookThink(entity this)
+{
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
        vector dir, org, end, v0, dv, v, myorg, vs;
        if(self.realowner.hook != self) // how did that happen?
@@ -299,11 +301,11 @@ void GrapplingHookThink()
        }
 }
 
-void GrapplingHookTouch ()
-{SELFPARAM();
+void GrapplingHookTouch (entity this)
+{
        if(other.movetype == MOVETYPE_FOLLOW)
                return;
-       PROJECTILE_TOUCH;
+       PROJECTILE_TOUCH(this);
 
        GrapplingHook_Stop();
 
@@ -383,8 +385,8 @@ void FireGrapplingHook ()
        missile.angles = vectoangles (missile.velocity);
        //missile.glow_color = 250; // 244, 250
        //missile.glow_size = 120;
-       missile.touch = GrapplingHookTouch;
-       missile.think = GrapplingHookThink;
+       settouch(missile, GrapplingHookTouch);
+       setthink(missile, GrapplingHookThink);
        missile.nextthink = time;
 
        missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;