From 33dd08774bceca053f2e31de10db9945e1709bbc Mon Sep 17 00:00:00 2001 From: AriosJentu Date: Mon, 26 Aug 2019 01:35:35 +1000 Subject: [PATCH] Remove unnecessary time increasing for pointblank --- qcsrc/server/client.qc | 26 +++++++++----------------- qcsrc/server/g_damage.qc | 4 ++-- 2 files changed, 11 insertions(+), 19 deletions(-) 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; } } -- 2.39.2