#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"
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;
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?
}
}
-void GrapplingHookTouch ()
-{SELFPARAM();
+void GrapplingHookTouch (entity this)
+{
if(other.movetype == MOVETYPE_FOLLOW)
return;
- PROJECTILE_TOUCH;
+ PROJECTILE_TOUCH(this);
GrapplingHook_Stop();
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;