]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge branch 'master' into TimePath/stats
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 5d9436f684ea4c3b87c2b1dcd6587b3bd214ceeb..dcd75023e6a9c393be0be286b7b2ed1d00f5eb0f 100644 (file)
@@ -12,7 +12,6 @@
 #include "weapons/accuracy.qh"
 #include "weapons/csqcprojectile.qh"
 #include "weapons/selection.qh"
-#include "../common/buffs/all.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes/all.qh"
 #include "../common/notifications.qh"
@@ -62,10 +61,8 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
        {
                // after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
                Weapon culprit = DEATH_WEAPONOF(deathtype);
-               if(!culprit)
-                       culprit = get_weaponinfo(attacker.weapon);
-               else if(!(attacker.weapons & WepSet_FromWeapon(culprit.m_id)))
-                       culprit = get_weaponinfo(attacker.weapon);
+               if(!culprit) culprit = get_weaponinfo(attacker.weapon);
+               else if(!(attacker.weapons & (culprit.m_wepset))) culprit = get_weaponinfo(attacker.weapon);
 
                if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
                {
@@ -85,7 +82,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
 
                        // all others (including the culprit): remove
                        GiveFrags_randomweapons.weapons &= ~attacker.weapons;
-                       GiveFrags_randomweapons.weapons &= ~WepSet_FromWeapon(culprit.m_id);
+                       GiveFrags_randomweapons.weapons &= ~(culprit.m_wepset);
 
                        // among the remaining ones, choose one by random
                        W_RandomWeapons(GiveFrags_randomweapons, 1);
@@ -93,7 +90,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
                        if(GiveFrags_randomweapons.weapons)
                        {
                                attacker.weapons |= GiveFrags_randomweapons.weapons;
-                               attacker.weapons &= ~WepSet_FromWeapon(culprit.m_id);
+                               attacker.weapons &= ~(culprit.m_wepset);
                        }
                }
 
@@ -262,6 +259,8 @@ float Obituary_WeaponDeath(
        return false;
 }
 
+.int buffs = _STAT(BUFFS); // TODO: remove
+
 void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
 {
        // Sanity check
@@ -856,7 +855,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        farcent.origin = hitloc;
                        farcent.forcetype = FORCETYPE_FORCEATPOS;
                        farcent.nextthink = time + 0.1;
-                       farcent.think = SUB_Remove;
+                       farcent.think = SUB_Remove_self;
                }
                else
                {