]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove unnecessary conditions and variables
authorAriosJentu <darthpoezd@gmail.com>
Sat, 24 Aug 2019 16:21:31 +0000 (02:21 +1000)
committerAriosJentu <darthpoezd@gmail.com>
Sat, 24 Aug 2019 16:21:31 +0000 (02:21 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/g_damage.qc

index 6be223d13c7dac6c905e6b3572e3c68079bb45c7..186fbe9f30d27f08c6bbba64666dd11483455687 100644 (file)
@@ -2394,6 +2394,7 @@ Called every frame for each client before the physics are run
 =============
 */
 .float last_vehiclecheck;
+.int shotgun_timer_time;
 void PlayerPreThink (entity this)
 {
 
@@ -2606,15 +2607,16 @@ void PlayerPreThink (entity this)
                } 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");
                        }
 
                        this.shotgun_timer = 0;
                        this.shotgun_timer_time = 0;
-                       this.shotgun_bullets_received = 0;
                        this.shotgun_inc_pointblank = 0;
                }
        }
index f65c01d24f11cecae71a8826eeac4d6dcb251efc..a648057f8abe0cc87fcd93bd169bce2e0c1cff25 100644 (file)
@@ -200,8 +200,6 @@ CLASS(Player, Client)
     ATTRIB(Player, buff_shield, float, this.buff_shield);
 
     ATTRIB(Player, shotgun_timer, bool, this.shotgun_timer);
-    ATTRIB(Player, shotgun_timer_time, int, this.shotgun_timer_time);
-    ATTRIB(Player, shotgun_bullets_received, int, this.shotgun_bullets_received);
     ATTRIB(Player, shotgun_bullets_received_from, entity, this.shotgun_bullets_received_from);
     ATTRIB(Player, shotgun_inc_pointblank, bool, this.shotgun_inc_pointblank);
 
index 9bb72981857df0ab57b97d719edc7fb577a92095..af52305d3f5708d5e574e9ca384ac97faa3ff391 100644 (file)
@@ -879,16 +879,11 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
 
                float distance = vlen(targ.origin-attacker.origin);
                
-               if (targ.shotgun_timer) {
-                       targ.shotgun_bullets_received += 1;
-               } else {
-                       targ.shotgun_bullets_received_from = attacker_save;
-                       targ.shotgun_bullets_received = 1;
-                       targ.shotgun_timer = 1;                 
-               }
+               targ.shotgun_timer = 1; 
+               targ.shotgun_bullets_received_from = attacker;  
 
                //Add condition to look at, not only for distance
-               if (distance < 65 && targ.shotgun_bullets_received) {
+               if (distance < 65) {
                        targ.shotgun_inc_pointblank = 1;
                }
        }