]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rewrite a code block so that it doesn't look like it depends on the above if condition
authorterencehill <piuntn@gmail.com>
Mon, 29 Jan 2018 16:27:29 +0000 (17:27 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 29 Jan 2018 16:27:29 +0000 (17:27 +0100)
qcsrc/server/client.qc

index 3d5f951a42e0b6b7d5be0ba019692c2aea9d1791..3333c04e49180286b6ef8806c91aa410baf0de1e 100644 (file)
@@ -1191,12 +1191,10 @@ void ClientConnect(entity this)
        }
        if (!teamplay && this.team_forced > 0) this.team_forced = 0;
 
-    {
-        int id = this.playerid;
-        this.playerid = 0; // silent
-           JoinBestTeam(this, false); // if the team number is valid, keep it
-           this.playerid = id;
-    }
+       int playerid_save = this.playerid;
+       this.playerid = 0; // silent
+       JoinBestTeam(this, false); // if the team number is valid, keep it
+       this.playerid = playerid_save;
 
        if (autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0) {
                TRANSMUTE(Observer, this);