From c109d79f376102e75b9cd058cd403f525d273435 Mon Sep 17 00:00:00 2001 From: AriosJentu Date: Mon, 26 Aug 2019 01:48:56 +1000 Subject: [PATCH] Add pointblank for CryLink, replace variable names, fix Immolation's bug with killing after suicide increasing --- qcsrc/server/client.qc | 13 ++++++------- qcsrc/server/client.qh | 6 +++--- qcsrc/server/g_damage.qc | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) 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; } -- 2.39.2