]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bug with no-frag for Self-Immolation achievement
authorAriosJentu <darthpoezd@gmail.com>
Sun, 25 Aug 2019 15:09:46 +0000 (01:09 +1000)
committerAriosJentu <darthpoezd@gmail.com>
Sun, 25 Aug 2019 15:09:46 +0000 (01:09 +1000)
qcsrc/server/g_damage.qc

index dae22c5c67fccdeaedf045bf480d1d8a5fa71e49..33dffd1a4cb3d89a2d4969e32366d52aa4e332ed 100644 (file)
@@ -288,12 +288,6 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                LogDeath("suicide", deathtype, targ, targ);
                if(deathtype != DEATH_AUTOTEAMCHANGE.m_id) // special case: don't negate frags if auto switched
                        GiveFrags(attacker, targ, -1, deathtype, weaponentity);
-               
-               attacker.suicide = 1;
-       }
-
-       if (targ != attacker) {
-               attacker.check_suicide = 1;
        }
 
        // ======
@@ -893,6 +887,14 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                        targ.shotgun_inc_pointblank = 1;
                }
        }
+
+       if (IS_DEAD(targ)) {
+               if (targ != attacker) {
+                       attacker.check_suicide = 1;
+               } else {
+                       attacker.suicide = 1;
+               }
+       }
 }
 
 float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe,