From: AriosJentu Date: Sun, 25 Aug 2019 15:35:35 +0000 (+1000) Subject: Remove unnecessary time increasing for pointblank X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=33dd08774bceca053f2e31de10db9945e1709bbc;p=xonotic%2Fxonotic-data.pk3dir.git Remove unnecessary time increasing for pointblank --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 80aca32d9..e7ff14c1c 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2394,7 +2394,6 @@ Called every frame for each client before the physics are run ============= */ .float last_vehiclecheck; -.int shotgun_timer_time; void PlayerPreThink (entity this) { @@ -2600,25 +2599,18 @@ void PlayerPreThink (entity this) //Bullets timer if (this.shotgun_timer) { - - if (this.shotgun_timer_time < 2) { //2 frames for reloading weapon - this.shotgun_timer_time++; - - } else { - - if (this.shotgun_inc_pointblank) { - entity attaker = this.shotgun_bullets_received_from; - entity achv = attaker.achievements; - - achv.inc_achievement(achv, "pointblank"); - achv.announce(achv, attaker, "Point Blank!", "pointblank"); - } + if (this.shotgun_inc_pointblank) { - this.shotgun_timer = 0; - this.shotgun_timer_time = 0; - this.shotgun_inc_pointblank = 0; + entity attaker = this.shotgun_bullets_received_from; + entity achv = attaker.achievements; + + achv.inc_achievement(achv, "pointblank"); + achv.announce(achv, attaker, "Point Blank!", "pointblank"); } + + this.shotgun_timer = 0; + this.shotgun_inc_pointblank = 0; } //Check suicide diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index fc50d3af0..0d7a1e604 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -875,7 +875,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de //Weapons achievements - if (DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) { + if (DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) || DEATH_ISWEAPON(deathtype, WEP_CRYLINK)) { float distance = vlen(targ.origin-attacker.origin); @@ -883,7 +883,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de targ.shotgun_bullets_received_from = attacker; //Add condition to look at, not only for distance - if (distance < 65) { + if (distance < 65 && targ != attacker) { targ.shotgun_inc_pointblank = 1; } }