]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix crash with increment achievement
authorAriosJentu <darthpoezd@gmail.com>
Sun, 8 Sep 2019 14:27:43 +0000 (00:27 +1000)
committerAriosJentu <darthpoezd@gmail.com>
Sun, 8 Sep 2019 14:27:43 +0000 (00:27 +1000)
qcsrc/server/g_damage.qc

index 3a2622783117c5e0d5a2d8f42725348257e2ae4c..84ab97f52a9a4b22d0b72e112e69f40ec423b4c8 100644 (file)
@@ -901,21 +901,22 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
        }
 
        if (IS_DEAD(targ) && IS_PLAYER(attacker)) {
+               
                if (targ != attacker) {
                        attacker.check_suicide = 1;
                        attacker.suicide = 0;
                } else {
                        attacker.suicide = 1;
                }
-       }
 
-       if(deathtype == DEATH_TELEFRAG.m_id) {
-               entity att_achv = attacker.achievements;
-               entity trg_achv = targ.achievements;
-               att_achv.inc_achievement(att_achv, "telefrag");
-               trg_achv.inc_achievement(trg_achv, "surprise");
-               att_achv.announce(att_achv, attacker, "telefrag");
-               trg_achv.announce(trg_achv, targ, "surprise");
+               if (deathtype == DEATH_TELEFRAG.m_id) {
+                       entity att_achv = attacker.achievements;
+                       entity trg_achv = targ.achievements;
+                       att_achv.inc_achievement(att_achv, "telefrag");
+                       trg_achv.inc_achievement(trg_achv, "surprise");
+                       att_achv.announce(att_achv, attacker, "telefrag");
+                       trg_achv.announce(trg_achv, targ, "surprise");
+               }
        }
 }