]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove unnecessary time increasing for pointblank
authorAriosJentu <darthpoezd@gmail.com>
Sun, 25 Aug 2019 15:35:35 +0000 (01:35 +1000)
committerAriosJentu <darthpoezd@gmail.com>
Sun, 25 Aug 2019 15:35:35 +0000 (01:35 +1000)
qcsrc/server/client.qc
qcsrc/server/g_damage.qc

index 80aca32d99298dcb5a15b535ececda693c49a355..e7ff14c1c057f33bd1b775a87ae734720b6f3a21 100644 (file)
@@ -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
index fc50d3af08a4b33e081f5d3464225f0461883609..0d7a1e604025296a8ee0cbbe20f8a875058bfc11 100644 (file)
@@ -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;
                }
        }