]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Removed wrong line
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index d5ad30104d440d7c16395915591bdbe28a94e271..a8f365cbc25e811df1b296c629dbbb095e06e2f3 100644 (file)
@@ -33,7 +33,7 @@ void UpdateFrags(entity player, int f)
 void GiveFrags (entity attacker, entity targ, float f, int deathtype)
 {
        // TODO route through PlayerScores instead
-       if(gameover) return;
+       if(game_stopped) return;
 
        if(f < 0)
        {
@@ -623,7 +623,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
        mirrordamage = 0;
        mirrorforce = 0;
 
-       if (gameover || targ.killcount == FRAGS_SPECTATOR)
+       if (game_stopped || targ.killcount == FRAGS_SPECTATOR)
                return;
 
     damage_targ = targ;
@@ -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)
                {
@@ -1029,7 +1029,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                        LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
 
 
-                                               total = 0.25 * pow(max(mininv_f, mininv_d), 2);
+                                               total = 0.25 * (max(mininv_f, mininv_d) ** 2);
 
                                                if(autocvar_g_throughfloor_debug)
                                                        LOG_INFOF(" steps=%f", total);