]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/player.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / player.qc
index dd0007e36b2cb6663161cc8b12e638b808002e27..3ca1bbc1b1116c73c224f211d88f51074b720467 100644 (file)
@@ -12,6 +12,7 @@
 #include <common/mapobjects/subs.qh>
 #include <common/mapobjects/teleporters.qh>
 #include <common/minigames/sv_minigames.qh>
+#include <common/mutators/mutator/status_effects/_mod.qh>
 #include <common/mutators/mutator/waypoints/waypointsprites.qh>
 #include <common/physics/player.qh>
 #include <common/playerstats.qh>
@@ -126,6 +127,7 @@ void CopyBody(entity this, float keepvelocity)
 
        if(clone.colormap <= maxclients && clone.colormap > 0)
                clone.colormap = 1024 + this.clientcolors;
+       clone.sv_entnum = etof(this); // sent to CSQC for color mapping purposes
 
        CSQCMODEL_AUTOINIT(clone);
        clone.CopyBody_nextthink = this.nextthink;
@@ -248,7 +250,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                        if (!ITEM_DAMAGE_NEEDKILL(deathtype))
                                damage = 0;
                }
-               else if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
+               else if (StatusEffects_active(STATUSEFFECT_SpawnShield, this) && autocvar_g_spawnshield_blockdamage < 1)
                        damage *= 1 - bound(0, autocvar_g_spawnshield_blockdamage, 1);
 
                if(deathtype & HITTYPE_SOUND) // sound based attacks cause bleeding from the ears
@@ -333,7 +335,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        if (take > 100)
                Violence_GibSplash_At(hitloc, force * -0.2, 3, 1, this, attacker);
 
-       if (time >= this.spawnshieldtime || autocvar_g_spawnshield_blockdamage < 1)
+       if (!StatusEffects_active(STATUSEFFECT_SpawnShield, this) || autocvar_g_spawnshield_blockdamage < 1)
        {
                if (!(this.flags & FL_GODMODE))
                {
@@ -558,9 +560,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                // don't play teleportation sounds
                this.teleportable = TELEPORT_SIMPLE;
 
-               STAT(STRENGTH_FINISHED, this) = 0;
-               STAT(INVINCIBLE_FINISHED, this) = 0;
-               STAT(SUPERWEAPONS_FINISHED, this) = 0;
                STAT(AIR_FINISHED, this) = 0;
 
                this.death_time = time;