From: Mario Date: Fri, 6 Feb 2015 12:40:08 +0000 (+1100) Subject: Allow swinging nades around with hook X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=78f0a11e8635ebdb5408591652d13357c91a359f;p=xonotic%2Fxonotic-data.pk3dir.git Allow swinging nades around with hook --- diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 92a797679..3af02550b 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -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) diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 163b291de..2d921dc9b 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -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); }