]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge branch 'sev/luma_update' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 9258b3e8237c7147ced213d8f26a3eedc4ca5eee..675b794ecdb902b73e018f3ccaad6356e4feeb42 100644 (file)
@@ -5,6 +5,8 @@
 #include "mutators/all.qh"
 #include "scores.qh"
 #include "spawnpoints.qh"
+#include "../common/state.qh"
+#include "../common/physics/player.qh"
 #include "../common/t_items.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/items/all.qc"
@@ -125,7 +127,7 @@ string AppendItemcodes(string s, entity player)
                s = strcat(s, "I");
        if(player.flagcarried != world)
                s = strcat(s, "F");
-       if(player.BUTTON_CHAT)
+       if(PHYS_INPUT_BUTTON_CHAT(player))
                s = strcat(s, "T");
        if(player.kh_next)
                s = strcat(s, "K");
@@ -326,7 +328,8 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                        return;
                }
                LogDeath("suicide", deathtype, targ, targ);
-               GiveFrags(attacker, targ, -1, deathtype);
+               if(deathtype != DEATH_AUTOTEAMCHANGE.m_id) // special case: don't negate frags if auto switched
+                       GiveFrags(attacker, targ, -1, deathtype);
        }
 
        // ======
@@ -538,7 +541,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.iceblock = ice;
        targ.revival_time = 0;
 
-       WITH(entity, self, ice, Ice_Think());
+       WITHSELF(ice, Ice_Think());
 
        RemoveGrapplingHook(targ);
 
@@ -551,6 +554,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
+    SELFPARAM();
        if(!STAT(FROZEN, targ))
                return;
 
@@ -801,7 +805,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                        {
                                                if(deathtype != DEATH_FIRE.m_id)
                                                {
-                                                       if(victim.BUTTON_CHAT)
+                                                       if(PHYS_INPUT_BUTTON_CHAT(victim))
                                                                attacker.typehitsound += 1;
                                                        else
                                                                attacker.damage_dealt += damage;
@@ -870,6 +874,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
        setself(this);
 
        // apply mirror damage if any
+       if(!autocvar_g_mirrordamage_onlyweapons || DEATH_WEAPONOF(deathtype) != WEP_Null)
        if(mirrordamage > 0 || mirrorforce > 0)
        {
                attacker = attacker_save;