]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reimplement "Don't play any pain sound when hitting a frozen player (it happened...
authorterencehill <piuntn@gmail.com>
Mon, 15 Jun 2020 14:02:21 +0000 (16:02 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 15 Jun 2020 14:02:21 +0000 (16:02 +0200)
qcsrc/server/player.qc

index 62822f6f05e2631d19ea7bd0e2dc8e2af147b268..d9def3977b3675968630e65f901287d966893d00 100644 (file)
@@ -326,7 +326,12 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                        }
                }
 
-               if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
+               if (STAT(FROZEN, this))
+               {
+                       if (!ITEM_DAMAGE_NEEDKILL(deathtype))
+                               damage = 0;
+               }
+               else if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
                        damage *= 1 - max(0, autocvar_g_spawnshield_blockdamage);
 
                if(deathtype & HITTYPE_SOUND) // sound based attacks cause bleeding from the ears
@@ -411,8 +416,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)
-               && !STAT(FROZEN, this))
+       if (time >= this.spawnshieldtime || autocvar_g_spawnshield_blockdamage < 1)
        {
                if (!(this.flags & FL_GODMODE))
                {
@@ -422,7 +426,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                        if(take)
                                this.pauseregen_finished = max(this.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
 
-                       if (time > this.pain_finished)          //Don't switch pain sequences like crazy
+                       if (time > this.pain_finished && !STAT(FROZEN, this)) // Don't switch pain sequences like crazy
                        {
                                this.pain_finished = time + 0.5;        //Supajoe