From 570a7acb4a72ca9722a0e282cde771d4f8c30d6d Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 18 Jul 2017 09:41:18 +1000 Subject: [PATCH] Port specialcommand_pos to ClientState --- qcsrc/common/physics/player.qc | 12 ++++++------ qcsrc/server/client.qh | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index ec255c8d3..5a41e91da 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -514,18 +514,18 @@ bool PM_check_specialcommand(entity this, int buttons) else c = "?"; - if (c == substring(specialcommand, this.specialcommand_pos, 1)) + if (c == substring(specialcommand, CS(this).specialcommand_pos, 1)) { - this.specialcommand_pos += 1; - if (this.specialcommand_pos >= strlen(specialcommand)) + CS(this).specialcommand_pos += 1; + if (CS(this).specialcommand_pos >= strlen(specialcommand)) { - this.specialcommand_pos = 0; + CS(this).specialcommand_pos = 0; SpecialCommand(this); return true; } } - else if (this.specialcommand_pos && (c != substring(specialcommand, this.specialcommand_pos - 1, 1))) - this.specialcommand_pos = 0; + else if (CS(this).specialcommand_pos && (c != substring(specialcommand, CS(this).specialcommand_pos - 1, 1))) + CS(this).specialcommand_pos = 0; #endif return false; } diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 097ba382b..88614214c 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -104,6 +104,7 @@ CLASS(Client, Object) ATTRIB(Client, accuracy, entity, this.accuracy); ATTRIB(Client, hasweapon_complain_spam, float, this.hasweapon_complain_spam); ATTRIB(Client, scorekeeper, entity, this.scorekeeper); + ATTRIB(Client, specialcommand_pos, int, this.specialcommand_pos); METHOD(Client, m_unwind, bool(Client this)); -- 2.39.2