]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow swinging nades around with hook
authorMario <zacjardine@y7mail.com>
Fri, 6 Feb 2015 12:40:08 +0000 (23:40 +1100)
committerMario <zacjardine@y7mail.com>
Fri, 6 Feb 2015 12:40:08 +0000 (23:40 +1100)
qcsrc/server/g_hook.qc
qcsrc/server/mutators/mutator_nades.qc

index 92a797679d90fbe6e5772cb64adc31501ab5ef99..3af02550b54c2bdb478334c703a6c9aa692b8d16 100644 (file)
@@ -144,7 +144,7 @@ void GrapplingHookThink()
                error("Owner lost the hook!\n");
                return;
        }
-       if(LostMovetypeFollow(self) || intermission_running || (self.aiment.flags & FL_PROJECTILE))
+       if(LostMovetypeFollow(self) || intermission_running || ((self.aiment.flags & FL_PROJECTILE) && self.aiment.classname != "nade"))
        {
                RemoveGrapplingHook(self.realowner);
                return;
@@ -248,7 +248,7 @@ void GrapplingHookThink()
                                dv = ((v - v0) * dir) * dir;
                                if(tarzan >= 2)
                                {
-                                       if(self.aiment.movetype == MOVETYPE_WALK)
+                                       if(self.aiment.movetype == MOVETYPE_WALK || self.aiment.classname == "nade")
                                        {
                                                entity aim_ent = ((IS_VEHICLE(self.aiment) && self.aiment.owner) ? self.aiment.owner : self.aiment);
                                                v = v - dv * 0.5;
@@ -257,6 +257,8 @@ void GrapplingHookThink()
                                                {
                                                        self.aiment.velocity = self.aiment.velocity - dv * 0.5;
                                                        self.aiment.flags &= ~FL_ONGROUND;
+                                                       if(self.aiment.flags & FL_PROJECTILE)
+                                                               UpdateCSQCProjectile(self.aiment);
                                                }
                                                aim_ent.pusher = self.realowner;
                                                aim_ent.pushltime = time + autocvar_g_maxpushtime;
@@ -267,7 +269,7 @@ void GrapplingHookThink()
                                realpull.flags &= ~FL_ONGROUND;
                        }
 
-                       if(!frozen_pulling)
+                       if(!frozen_pulling && !(self.aiment.flags & FL_PROJECTILE))
                                realpull.velocity = WarpZone_RefSys_TransformVelocity(self, realpull, ((realpull == self.realowner) ? v : (v * autocvar_g_balance_grapplehook_piggybackfriction)));
 
                        if(frozen_pulling && autocvar_g_balance_grapplehook_pull_frozen == 2 && !self.aiment.frozen)
index 163b291de20432ab0d032cd84cfabbfdb9dea6e4..2d921dc9b8d06e1a24a054f548e8212149a7619b 100644 (file)
@@ -547,6 +547,11 @@ void nade_boom()
                case NADE_TYPE_MONSTER: nade_monster_boom(); break;
        }
 
+       entity head;
+       for(head = world; (head = find(head, classname, "grapplinghook")); )
+       if(head.aiment == self)
+               RemoveGrapplingHook(head.realowner);
+
        remove(self);
 }