]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve comments
authorterencehill <piuntn@gmail.com>
Sun, 18 Feb 2018 00:21:41 +0000 (01:21 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 18 Feb 2018 00:21:41 +0000 (01:21 +0100)
qcsrc/server/client.qc
qcsrc/server/player.qc
qcsrc/server/weapons/accuracy.qc

index a25ec56825ba71f6fbab8b747068ff1cff033fe4..f0837f18017da680fc56745d8919cf99f3017c8e 100644 (file)
@@ -2760,6 +2760,8 @@ void PlayerPostThink (entity this)
        if (IS_PLAYER(this)) {
                if(this.death_time == time && IS_DEAD(this))
                {
+                       // player's bbox gets resized now, instead of in the damage event that killed the player,
+                       // once all the damage events of this frame have been processed with normal size
                        this.maxs.z = 5;
                        setsize(this, this.mins, this.maxs);
                }
index 88acd12f979522b3849813ac39064d3972222664..27c11b1e216c986f21eb96aaa9cf3958c6357d94 100644 (file)
@@ -627,15 +627,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                else
                        animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD2, true);
 
-               /* // postpone resize until frame end so that dead player can still
-               // properly get hit by all the projectiles fired in this frame (shotgun)
-               if (this.maxs.z > 5)
-               {
-                       this.maxs_z = 5;
-                       setsize(this, this.mins, this.maxs);
-               }
-               */
-
                // set damage function to corpse damage
                this.event_damage = PlayerCorpseDamage;
                // call the corpse damage function just in case it wants to gib
index 3dece7801c5c91e1ebee3c7610177c52131f6100..c0441ca162a375e20daa917385a118539f12e18b 100644 (file)
@@ -93,6 +93,9 @@ bool accuracy_isgooddamage(entity attacker, entity targ)
        int mutator_check = MUTATOR_CALLHOOK(AccuracyTargetValid, attacker, targ);
 
        if (warmup_stage) return false;
+
+       // damage to dead/frozen players is good only if it happens in the frame they get killed / frozen
+       // so that stats for weapons that shoot multiple projectiles per shot are properly counted
        if (IS_DEAD(targ) && time > targ.death_time) return false;
        if (STAT(FROZEN, targ) && time > targ.freeze_time) return false;
        if (SAME_TEAM(attacker, targ)) return false;