From: Mario Date: Mon, 17 Jul 2017 23:41:18 +0000 (+1000) Subject: Port specialcommand_pos to ClientState X-Git-Tag: xonotic-v0.8.5~2570 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=570a7acb4a72ca9722a0e282cde771d4f8c30d6d;p=xonotic%2Fxonotic-data.pk3dir.git Port specialcommand_pos to ClientState --- 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));