]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port version_mismatch to ClientState
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 22:46:38 +0000 (08:46 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 22:46:38 +0000 (08:46 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/defs.qh
qcsrc/server/teamplay.qc

index 4a1961df899a2eeb9475af1b69b9f01bb70e1172..b29f785b9cdc5e49f89fa50b4903e9a2ff9643d5 100644 (file)
@@ -2099,7 +2099,7 @@ void PrintWelcomeMessage(entity this)
 
 bool joinAllowed(entity this)
 {
-       if (this.version_mismatch) return false;
+       if (CS(this).version_mismatch) return false;
        if (!nJoinAllowed(this, this)) return false;
        if (teamplay && lockteams) return false;
        if (ShowTeamSelection(this)) return false;
@@ -2306,7 +2306,7 @@ void ObserverThink(entity this)
                if (PHYS_INPUT_BUTTON_JUMP(this) && joinAllowed(this)) {
                        this.flags &= ~FL_JUMPRELEASED;
                        this.flags |= FL_SPAWNING;
-               } else if(PHYS_INPUT_BUTTON_ATCK(this) && !this.version_mismatch) {
+               } else if(PHYS_INPUT_BUTTON_ATCK(this) && !CS(this).version_mismatch) {
                        this.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext(this)) {
                                TRANSMUTE(Spectator, this);
index 532bf899b0f04b5e45ee63963dc89df866d4e775..30451313202097f54e0891541b87f7ad46c6cb24 100644 (file)
@@ -89,6 +89,7 @@ CLASS(Client, Object)
     ATTRIB(Client, active_minigame, entity, this.active_minigame);
     ATTRIB(Client, taunt_soundtime, float, this.taunt_soundtime);
     ATTRIB(Client, killcount, int, this.killcount);
+    ATTRIB(Client, version_mismatch, bool, this.version_mismatch);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index da9fd8621f171b34aed6ab9ca144b3e0a563fa37..ef1116317ce071aebac0d093f7eb35d2c99123f9 100644 (file)
@@ -105,7 +105,7 @@ void ClientCommand_clientversion(entity caller, float request, float argc)  // i
 
                                        if (caller.version < autocvar_gameversion_min || caller.version > autocvar_gameversion_max)
                                        {
-                                               caller.version_mismatch = 1;
+                                               CS(caller).version_mismatch = true;
                                                ClientKill_TeamChange(caller, -2);  // observe
                                        }
                                        else if (autocvar_g_campaign || autocvar_g_balance_teams)
index 9c14d9ccb6c28c3a23a31f3ab736d8dd08cf4689..07bec4b6c2abc0301bee338c1bec478f1e0dfc33 100644 (file)
@@ -243,8 +243,6 @@ float next_pingtime;
 .float cvar_cl_voice_directional;
 .float cvar_cl_voice_directional_taunt_attenuation;
 
-.float version_mismatch;
-
 int autocvar__independent_players;
 bool independent_players;
 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
index d8bf72cd6b2a87bc27cc3700053716840c3bd8b3..51ad5edb93c16cc91250277f35b5bf4f0cc88690 100644 (file)
@@ -87,7 +87,7 @@ void InitGameplayMode()
 
 string GetClientVersionMessage(entity this)
 {
-       if (this.version_mismatch) {
+       if (CS(this).version_mismatch) {
                if(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");