Commits

Torr_Samaho  committed 1b058a7

[TIHan] Fixed: Players could choose their team by using "team" or "changeteam" commands as a spectator when sv_noteamselect was true.

  • Participants
  • Parent commits 2d56ea4

Comments (0)

Files changed (3)

File docs/Skulltag Version History.txt

 -	- Fixed: Poly object doors were not handled properly online. [TIHan]
 -	- Fixed: Newly connected clients were not properly informed of poly objects. [TIHan]
 -	- Fixed some Z position sync problems of floating monsters online. [TIHan]
+-	- Fixed: Players could choose their team by using "team" or "changeteam" commands as a spectator when sv_noteamselect was true. [TIHan]
 !	- Changed F12 to allow spectators full spying, with the exception of during LMS if it's disabled. [Eruanna]
 !	- Changed F12 to allow full demo spying. [Eruanna]
 !	- Players aren't forced to spectate after a "changemap" map change on a server with a join password anymore. [Torr Samaho]

File src/sv_main.cpp

 	if ( teamlms && ( players[g_lCurrentClient].bDeadSpectator ))
 		return ( false );
 
+	// [WS] "No team select" dmflag is set. Ignore this.
+	if ( players[g_lCurrentClient].bSpectating && ( dmflags2 & DF2_NO_TEAM_SELECT ) )
+		return ( false );
+
 	// "No team change" dmflag is set. Ignore this.
 	if ( players[g_lCurrentClient].bOnTeam && ( dmflags2 & DF2_NO_TEAM_SWITCH ))
 		return ( false );

File src/team.cpp

 		return;
 	}
 
+	// [WS] "No team select" dmflag is set. Ignore this.
+	if ( players[consoleplayer].bSpectating && ( dmflags2 & DF2_NO_TEAM_SELECT ) )
+	{
+		Printf( "You are not allowed to choose your team!\n" );
+		return;
+	}
+
 	// "No team change" dmflag is set. Ignore this.
 	if (( players[consoleplayer].bOnTeam ) &&
 		( dmflags2 & DF2_NO_TEAM_SWITCH ))