From: terencehill Date: Thu, 21 Feb 2019 17:30:15 +0000 (+0100) Subject: Don't even try to count damage as score if it's null X-Git-Tag: xonotic-v0.8.5~1595 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73a69d6dfe45a30c4fe274eae18198fe4629216d;p=xonotic%2Fxonotic-data.pk3dir.git Don't even try to count damage as score if it's null --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index f52cb75bb..b8d3c903c 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -467,8 +467,9 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, this.v_angle_x = bound(-90, this.v_angle.x, 90); } - if (this != attacker) { - float realdmg = damage - excess; + float realdmg = damage - excess; + if (this != attacker && realdmg) + { if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this)) { GameRules_scoring_add(attacker, DMG, realdmg); } @@ -552,7 +553,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, // print an obituary message if(this.classname != "body") - Obituary (attacker, inflictor, this, deathtype, weaponentity); + Obituary(attacker, inflictor, this, deathtype, weaponentity); // increment frag counter for used weapon type Weapon w = DEATH_WEAPONOF(deathtype);