]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove grappling hook more safely
authorRudolf Polzer <divverent@xonotic.org>
Wed, 12 Oct 2011 04:39:43 +0000 (06:39 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 12 Oct 2011 04:39:43 +0000 (06:39 +0200)
qcsrc/server/cl_player.qc
qcsrc/server/g_hook.qc

index 13cf1ad68828f32856b54f5fab2a93600bbfb7c5..92e1ce4dea150f5a22cca701b11f05252035cba3 100644 (file)
@@ -660,6 +660,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                MUTATOR_CALLHOOK(PlayerDies);
                weapon_action(self.weapon, WR_PLAYERDEATH);
 
+               RemoveGrapplingHook(self);
+
                if(self.flagcarried)
                {
                        if(attacker.classname != "player")
index ce815fad4012a13fa6e4354a2bbd7e17d4c5b478..b08ef098609732a67a18effdfd6e094d7f1f4a3e 100644 (file)
@@ -116,9 +116,9 @@ void GrapplingHookThink()
 {
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch, s;
        vector dir, org, end, v0, dv, v, myorg, vs;
-       if(self.realowner.health <= 0 || self.realowner.hook != self)   // how did that happen?
-       {                                                                                                               // well, better fix it anyway
-               remove(self);
+       if(self.realowner.hook != self) // how did that happen?
+       {
+               error("Owner lost the hook!\n");
                return;
        }
        if(LostMovetypeFollow(self))