From: Mario Date: Tue, 26 Jun 2018 12:15:04 +0000 (+1000) Subject: Don't count dmg score if player has spawn shield or godmode X-Git-Tag: xonotic-v0.8.5~1979 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e56a16ecb366fda01ed8a543bdd3a5bee08f694;p=xonotic%2Fxonotic-data.pk3dir.git Don't count dmg score if player has spawn shield or godmode --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index cc58cdc6d..5bd4b5989 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -462,6 +462,16 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, this.v_angle_y = this.v_angle.y + (random() * 2 - 1) * shake; this.v_angle_x = bound(-90, this.v_angle.x, 90); } + + if (this != attacker) { + float realdmg = damage - excess; + if (IS_PLAYER(attacker)) { + GameRules_scoring_add(attacker, DMG, realdmg); + } + if (IS_PLAYER(this)) { + GameRules_scoring_add(this, DMGTAKEN, realdmg); + } + } } else this.max_armorvalue += (save + take); @@ -470,16 +480,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, this.dmg_take = this.dmg_take + take;//max(take - 10, 0); this.dmg_inflictor = inflictor; - if (this != attacker) { - float realdmg = damage - excess; - if (IS_PLAYER(attacker)) { - GameRules_scoring_add(attacker, DMG, realdmg); - } - if (IS_PLAYER(this)) { - GameRules_scoring_add(this, DMGTAKEN, realdmg); - } - } - bool abot = (IS_BOT_CLIENT(attacker)); bool vbot = (IS_BOT_CLIENT(this));