]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_hook.qc
Merge remote branch 'origin/master' into samual/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index dfd68e2ecc4efc4ff92dc8b1ea2e9c2fef78e9b5..27a63c421034ff2c0fe20cb640bfa887304cb830 100644 (file)
@@ -271,21 +271,24 @@ void GrapplingHookTouch (void)
 
 void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
-       if(self.health > 0)
-       {
-               self.health = self.health - damage;
+       if(self.health <= 0)
+               return;
                
-               print(strcat("hook health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, 0)) // no exceptions
+               return; // g_balance_projectiledamage says to halt
+                       
+       self.health = self.health - damage;
                
-               if (self.health <= 0)
+       print(strcat("hook health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
+               
+       if (self.health <= 0)
+       {
+               if(attacker != self.realowner)
                {
-                       if(attacker != self.realowner)
-                       {
-                               self.realowner.pusher = attacker;
-                               self.realowner.pushltime = time + autocvar_g_maxpushtime;
-                       }
-                       RemoveGrapplingHook(self.realowner);
+                       self.realowner.pusher = attacker;
+                       self.realowner.pushltime = time + autocvar_g_maxpushtime;
                }
+               RemoveGrapplingHook(self.realowner);
        }
 }