From: terencehill Date: Sun, 18 Feb 2018 00:21:41 +0000 (+0100) Subject: Improve comments X-Git-Tag: xonotic-v0.8.5~2281^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c2c513d8fdf53f5a763029173c0e1065a0e6de6;p=xonotic%2Fxonotic-data.pk3dir.git Improve comments --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index a25ec5682..f0837f180 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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); } diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 88acd12f9..27c11b1e2 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -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 diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 3dece7801..c0441ca16 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -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;