From: terencehill Date: Mon, 29 Jan 2018 16:27:29 +0000 (+0100) Subject: Rewrite a code block so that it doesn't look like it depends on the above if condition X-Git-Tag: xonotic-v0.8.5~2366 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ab7c93c9d0fcfa4c9689d3fdf91d71ea0e37c610;p=xonotic%2Fxonotic-data.pk3dir.git Rewrite a code block so that it doesn't look like it depends on the above if condition --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 3d5f951a4..3333c04e4 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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);