Check for damage to the player for removing hooks AFTER damage has been modified...
authorMario <mario@smbclan.net>
Sat, 11 Mar 2017 15:50:02 +0000 (01:50 +1000)
committerMario <mario@smbclan.net>
Sat, 11 Mar 2017 15:50:02 +0000 (01:50 +1000)
qcsrc/server/g_damage.qc

index 11c339b..a8f365c 100644 (file)
@@ -631,16 +631,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
     damage_attacker = attacker;
        attacker_save = attacker;
 
-       if(IS_PLAYER(targ))
-       {
-               for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-           {
-               .entity weaponentity = weaponentities[slot];
-               if(targ.(weaponentity).hook && targ.(weaponentity).hook.aiment == attacker)
-                       RemoveHook(targ.(weaponentity).hook);
-           }
-       }
-
        // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
        if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))
        {
@@ -743,6 +733,16 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                mirrordamage = M_ARGV(5, float);
                force = M_ARGV(6, vector);
 
+               if(IS_PLAYER(targ) && damage > 0 && attacker)
+               {
+                       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+                   {
+                       .entity weaponentity = weaponentities[slot];
+                       if(targ.(weaponentity).hook && targ.(weaponentity).hook.aiment == attacker)
+                               RemoveHook(targ.(weaponentity).hook);
+                   }
+               }
+
                if(STAT(FROZEN, targ))
                if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id)
                {