]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port version to ClientState
authorMario <mario@smbclan.net>
Sun, 16 Jul 2017 08:29:55 +0000 (18:29 +1000)
committerMario <mario@smbclan.net>
Sun, 16 Jul 2017 08:29:55 +0000 (18:29 +1000)
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/defs.qh
qcsrc/server/teamplay.qc

index 30451313202097f54e0891541b87f7ad46c6cb24..be6cc0d605e308191fb601024937f05b741f2551 100644 (file)
@@ -90,6 +90,7 @@ CLASS(Client, Object)
     ATTRIB(Client, taunt_soundtime, float, this.taunt_soundtime);
     ATTRIB(Client, killcount, int, this.killcount);
     ATTRIB(Client, version_mismatch, bool, this.version_mismatch);
+    ATTRIB(Client, version, int, this.version);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index ef1116317ce071aebac0d093f7eb35d2c99123f9..6d7ee81af4ddc7807696a6085ebe11073ebba5c3 100644 (file)
@@ -101,9 +101,9 @@ void ClientCommand_clientversion(entity caller, float request, float argc)  // i
                        {
                                if (IS_CLIENT(caller))
                                {
-                                       caller.version = ((argv(1) == "$gameversion") ? 1 : stof(argv(1)));
+                                       CS(caller).version = ((argv(1) == "$gameversion") ? 1 : stof(argv(1)));
 
-                                       if (caller.version < autocvar_gameversion_min || caller.version > autocvar_gameversion_max)
+                                       if (CS(caller).version < autocvar_gameversion_min || CS(caller).version > autocvar_gameversion_max)
                                        {
                                                CS(caller).version_mismatch = true;
                                                ClientKill_TeamChange(caller, -2);  // observe
index 07bec4b6c2abc0301bee338c1bec478f1e0dfc33..1c65847f4f2989ca6817e5e594952164a7ca9665 100644 (file)
@@ -131,8 +131,6 @@ float intermission_running;
 float intermission_exittime;
 float alreadychangedlevel;
 
-.float version;
-
 // footstep interval
 .float nextstep;
 
index 51ad5edb93c16cc91250277f35b5bf4f0cc88690..1cc9db2b970eb0357db1ab57c7f61480c539451c 100644 (file)
@@ -88,7 +88,7 @@ void InitGameplayMode()
 string GetClientVersionMessage(entity this)
 {
        if (CS(this).version_mismatch) {
-               if(this.version < autocvar_gameversion) {
+               if(CS(this).version < autocvar_gameversion) {
                        return strcat("This is Xonotic ", autocvar_g_xonoticversion,
                                "\n^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8");
                } else {