]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port specialcommand_pos to ClientState
authorMario <mario@smbclan.net>
Mon, 17 Jul 2017 23:41:18 +0000 (09:41 +1000)
committerMario <mario@smbclan.net>
Mon, 17 Jul 2017 23:41:18 +0000 (09:41 +1000)
qcsrc/common/physics/player.qc
qcsrc/server/client.qh

index ec255c8d3c66defdcee629cbfcd8f903529ffe44..5a41e91da9798cfaccb42aae639ac449077ab772 100644 (file)
@@ -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;
 }
index 097ba382bf93e35c881df5069c89dc0ef4feb66f..88614214cccb5291889d7a3f2d69a7e8ad45e0bd 100644 (file)
@@ -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));