- else if(PlayerInIDList(self, autocvar_g_forced_team_red))
- self.team_forced = NUM_TEAM_1;
- else if(PlayerInIDList(self, autocvar_g_forced_team_blue))
- self.team_forced = NUM_TEAM_2;
- else if(PlayerInIDList(self, autocvar_g_forced_team_yellow))
- self.team_forced = NUM_TEAM_3;
- else if(PlayerInIDList(self, autocvar_g_forced_team_pink))
- self.team_forced = NUM_TEAM_4;
- else if(autocvar_g_forced_team_otherwise == "red")
- self.team_forced = NUM_TEAM_1;
- else if(autocvar_g_forced_team_otherwise == "blue")
- self.team_forced = NUM_TEAM_2;
- else if(autocvar_g_forced_team_otherwise == "yellow")
- self.team_forced = NUM_TEAM_3;
- else if(autocvar_g_forced_team_otherwise == "pink")
- self.team_forced = NUM_TEAM_4;
- else if(autocvar_g_forced_team_otherwise == "spectate")
- self.team_forced = -1;
- else if(autocvar_g_forced_team_otherwise == "spectator")
- self.team_forced = -1;
- else
- self.team_forced = 0;
-
- if(!teamplay)
- if(self.team_forced > 0)
- self.team_forced = 0;
+ else if (PlayerInIDList(this, autocvar_g_forced_team_red)) this.team_forced = NUM_TEAM_1;
+ else if (PlayerInIDList(this, autocvar_g_forced_team_blue)) this.team_forced = NUM_TEAM_2;
+ else if (PlayerInIDList(this, autocvar_g_forced_team_yellow)) this.team_forced = NUM_TEAM_3;
+ else if (PlayerInIDList(this, autocvar_g_forced_team_pink)) this.team_forced = NUM_TEAM_4;
+ else switch (autocvar_g_forced_team_otherwise)
+ {
+ default: this.team_forced = 0; break;
+ case "red": this.team_forced = NUM_TEAM_1; break;
+ case "blue": this.team_forced = NUM_TEAM_2; break;
+ case "yellow": this.team_forced = NUM_TEAM_3; break;
+ case "pink": this.team_forced = NUM_TEAM_4; break;
+ case "spectate":
+ case "spectator":
+ this.team_forced = -1;
+ break;
+ }
+ if (!teamplay && this.team_forced > 0) this.team_forced = 0;