]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't count dmg score if player has spawn shield or godmode
authorMario <mario@smbclan.net>
Tue, 26 Jun 2018 12:15:04 +0000 (22:15 +1000)
committerMario <mario@smbclan.net>
Tue, 26 Jun 2018 12:15:04 +0000 (22:15 +1000)
qcsrc/server/player.qc

index cc58cdc6d7ca7e2bc493b9c2bd1518a3aaa3bbe2..5bd4b59894e964fcd6b0850a3f67232c8f38a79c 100644 (file)
@@ -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));