From: AriosJentu Date: Sun, 25 Aug 2019 15:48:56 +0000 (+1000) Subject: Add pointblank for CryLink, replace variable names, fix Immolation's bug with killing... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c109d79f376102e75b9cd058cd403f525d273435;p=xonotic%2Fxonotic-data.pk3dir.git Add pointblank for CryLink, replace variable names, fix Immolation's bug with killing after suicide increasing --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index e7ff14c1c..ddb6bbe56 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2598,19 +2598,18 @@ void PlayerPreThink (entity this) } //Bullets timer - if (this.shotgun_timer) { + if (this.pointblank_checker) { - if (this.shotgun_inc_pointblank) { + if (this.pointblank_increase) { - entity attaker = this.shotgun_bullets_received_from; - entity achv = attaker.achievements; + entity achv = this.achievements; achv.inc_achievement(achv, "pointblank"); - achv.announce(achv, attaker, "Point Blank!", "pointblank"); + achv.announce(achv, this, "Point Blank!", "pointblank"); } - this.shotgun_timer = 0; - this.shotgun_inc_pointblank = 0; + this.pointblank_checker = 0; + this.pointblank_increase = 0; } //Check suicide diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 478c4d24c..ea3cb89b6 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -199,9 +199,9 @@ CLASS(Player, Client) ATTRIB(Player, prevstrengthsoundattempt, float, this.prevstrengthsoundattempt); ATTRIB(Player, buff_shield, float, this.buff_shield); - ATTRIB(Player, shotgun_timer, bool, this.shotgun_timer); - ATTRIB(Player, shotgun_bullets_received_from, entity, this.shotgun_bullets_received_from); - ATTRIB(Player, shotgun_inc_pointblank, bool, this.shotgun_inc_pointblank); + ATTRIB(Player, pointblank_checker, bool, this.pointblank_checker); + ATTRIB(Player, pointblank_attacker, entity, this.pointblank_attacker); + ATTRIB(Player, pointblank_increase, bool, this.pointblank_increase); ATTRIB(Player, check_suicide, bool, this.check_suicide); ATTRIB(Player, suicide, bool, this.suicide); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 0d7a1e604..d9dcc32a4 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -879,18 +879,18 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de float distance = vlen(targ.origin-attacker.origin); - targ.shotgun_timer = 1; - targ.shotgun_bullets_received_from = attacker; + attacker.pointblank_checker = 1; //Add condition to look at, not only for distance if (distance < 65 && targ != attacker) { - targ.shotgun_inc_pointblank = 1; + attacker.pointblank_increase = 1; } } if (IS_DEAD(targ) && IS_PLAYER(attacker)) { if (targ != attacker) { attacker.check_suicide = 1; + attacker.suicide = 0; } else { attacker.suicide = 1; }