]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Register the ranking cvar in CSQC so it has a default value on older clients
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index c22f0d40274e82188c1c3c0451c02d2f3b49dcd2..b61f425aa6da44b8d9d4f073a7929275f54a5685 100644 (file)
@@ -143,6 +143,8 @@ void CSQC_Init()
        registercvar("cl_weapon_switch_reload", "1");
        registercvar("cl_weapon_switch_fallback_to_impulse", "1");
 
+       registercvar("cl_allow_uidranking", "1");
+
        if(autocvar_cl_lockview)
                cvar_set("cl_lockview", "0");
 
@@ -230,6 +232,8 @@ void Shutdown()
 
        deactivate_minigame();
        HUD_MinigameMenu_Close(NULL, NULL, NULL);
+
+       ReplicateVars(true); // destroy
 }
 
 .float has_team;
@@ -308,7 +312,7 @@ bool SetTeam(entity o, int Team)
 
 void Playerchecker_Think(entity this)
 {
-    int i;
+       int i;
        entity e;
        for(i = 0; i < maxclients; ++i)
        {
@@ -1121,17 +1125,15 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew)
                        break;
 
                case RACE_NET_PENALTY_RACE:
-                       race_penaltyeventtime = time;
-                       race_penaltytime = ReadShort();
-                       //race_penaltyaccumulator += race_penaltytime;
-                       strcpy(race_penaltyreason, ReadString());
-                       break;
-
                case RACE_NET_PENALTY_QUALIFYING:
                        race_penaltyeventtime = time;
                        race_penaltytime = ReadShort();
-                       race_penaltyaccumulator += race_penaltytime;
-                       strcpy(race_penaltyreason, ReadString());
+                       string reason = ReadString();
+                       if (reason == "missing a checkpoint")
+                               reason = _("missing a checkpoint");
+                       strcpy(race_penaltyreason, reason);
+                       if (b == RACE_NET_PENALTY_QUALIFYING)
+                               race_penaltyaccumulator += race_penaltytime;
                        break;
 
                case RACE_NET_SERVER_RECORD:
@@ -1152,12 +1154,12 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew)
                        break;
                case RACE_NET_SERVER_RANKINGS:
                        float prevpos, del;
-            int pos = ReadShort();
+                       int pos = ReadShort();
                        prevpos = ReadShort();
                        del = ReadShort();
 
                        // move other rankings out of the way
-            int i;
+                       int i;
                        if (prevpos) {
                                int m = min(prevpos, RANKINGS_DISPLAY_CNT);
                                for (i=m-1; i>pos-1; --i) {