From: AriosJentu Date: Sun, 8 Sep 2019 14:27:43 +0000 (+1000) Subject: Fix crash with increment achievement X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cea1292375db64a19a00a1a933b3c1abffbec870;p=xonotic%2Fxonotic-data.pk3dir.git Fix crash with increment achievement --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 3a2622783..84ab97f52 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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"); + } } }