]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some improvements for hooking nades
authorMario <zacjardine@y7mail.com>
Sun, 26 Apr 2015 06:27:25 +0000 (16:27 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 26 Apr 2015 06:27:25 +0000 (16:27 +1000)
qcsrc/server/autocvars.qh
qcsrc/server/g_hook.qc
qcsrc/server/mutators/mutator_nades.qc

index 80ef32afc4eaa11c1de656c601005503c4b48890..afa682de90006f7082872e052f0844e9a8656e8c 100644 (file)
@@ -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;
index 8c16f5c75655e8e190b65a6f67af1c6f865b39b7..ce8baf4d2073707d70af39863154e4cc8da3545d 100644 (file)
@@ -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;
index 6d8780d4d3d3b219d8207304b9cc3dd73b545d17..4d11f14af569513f27df9e754e45e35c53936a66 100644 (file)
@@ -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;
        }