]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_hook.qc
Merge remote-tracking branch 'origin/terencehill/cmd_fixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index 13efb17b7f6b20dc3ff5d646e9ebe12fea62bbd7..8867d0725b0f7c3a6cea40d022c5e133a01291dc 100644 (file)
@@ -116,12 +116,12 @@ 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))
+       if(LostMovetypeFollow(self) || intermission_running)
        {
                RemoveGrapplingHook(self.realowner);
                return;
@@ -213,6 +213,7 @@ void GrapplingHookThink()
                                                self.aiment.flags &~= FL_ONGROUND;
                                                self.aiment.pusher = self.realowner;
                                                self.aiment.pushltime = time + autocvar_g_maxpushtime;
+                                               self.aiment.istypefrag = self.aiment.BUTTON_CHAT;
                                        }
                                }
 
@@ -279,14 +280,13 @@ void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, floa
                        
        self.health = self.health - damage;
                
-       print(strcat("hook health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
-               
        if (self.health <= 0)
        {
                if(attacker != self.realowner)
                {
                        self.realowner.pusher = attacker;
                        self.realowner.pushltime = time + autocvar_g_maxpushtime;
+                       self.realowner.istypefrag = self.realowner.BUTTON_CHAT;
                }
                RemoveGrapplingHook(self.realowner);
        }
@@ -294,8 +294,8 @@ void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, floa
 
 void FireGrapplingHook (void)
 {
-       local entity missile;
-       local vector org;
+       entity missile;
+       vector org;
        float s;
        vector vs;
 
@@ -384,7 +384,7 @@ void FireGrapplingHook (void)
 
 void GrapplingHookFrame()
 {
-       if(g_grappling_hook && timeoutStatus != 2 && self.weapon != WEP_HOOK)
+       if(g_grappling_hook && timeout_status != TIMEOUT_ACTIVE && self.weapon != WEP_HOOK)
        {
                // offhand hook controls
                if(self.BUTTON_HOOK)