From 90fc54e34df7d45d0fe3188f60387d6fa6e0e629 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 26 Apr 2015 16:27:25 +1000 Subject: [PATCH] Some improvements for hooking nades --- qcsrc/server/autocvars.qh | 1 + qcsrc/server/g_hook.qc | 2 ++ qcsrc/server/mutators/mutator_nades.qc | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 80ef32afc..afa682de9 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -105,6 +105,7 @@ float autocvar_g_balance_fuel_rot; float autocvar_g_balance_fuel_rotlinear; int autocvar_g_balance_fuel_rotstable; float autocvar_g_balance_grapplehook_piggybackfriction = 1; +float autocvar_g_balance_grapplehook_nade_time = 0.7; float autocvar_g_balance_grapplehook_airfriction; float autocvar_g_balance_grapplehook_force_rubber; float autocvar_g_balance_grapplehook_force_rubber_overstretch; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 8c16f5c75..ce8baf4d2 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -261,6 +261,8 @@ void GrapplingHookThink() if(self.aiment.flags & FL_PROJECTILE) UpdateCSQCProjectile(self.aiment); } + if(self.aiment.classname == "nade") + self.aiment.nextthink = time + autocvar_g_balance_grapplehook_nade_time; // set time after letting go? aim_ent.pusher = self.realowner; aim_ent.pushltime = time + autocvar_g_maxpushtime; aim_ent.istypefrag = aim_ent.BUTTON_CHAT; diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 6d8780d4d..4d11f14af 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -565,6 +565,10 @@ void nade_touch() is_weapclip = 1;*/ if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip) { + entity head; + for(head = world; (head = find(head, classname, "grapplinghook")); ) + if(head.aiment == self) + RemoveGrapplingHook(head.realowner); remove(self); return; } -- 2.39.2