case "prespawn": break; // handled by engine in host_cmd.c
case "sentcvar": break; // handled by server in this file
case "spawn": break; // handled by engine in host_cmd.c
- case "color": case "topcolor": case "bottomcolor": if(teamplay) return; else break; // handled by engine in host_cmd.c
+ case "color": case "topcolor": case "bottomcolor": // handled by engine in host_cmd.c
+ if(!IS_CLIENT(this)) // on connection
+ {
+ // since gamecode doesn't have any calls earlier than this, do the connecting message here
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CONNECTING, this.netname);
+ }
+ if(teamplay)
+ return;
+ break;
case "c2s": Net_ClientCommand(this, command); return; // handled by net.qh
default:
{
SetPlayerColors(player, new_color);
}
- // TODO: Should we really bother with this?
if(!IS_CLIENT(player))
{
- // since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CONNECTING,
- player.netname);
return;
}
if (!teamplay)
{
return;
}
- Player_SetTeamIndexChecked(player, Team_TeamToIndex((new_color & 0x0F) +
- 1));
+ Player_SetTeamIndexChecked(player, Team_TeamToIndex((new_color & 0x0F) + 1));
}
int TeamBalance_CompareTeamsInternal(entity team_a, entity team_index_b,
entity player, bool use_score);
-/// \brief Called when the player connects or when they change their color with
-/// the "color" command.
+/// \brief Called when the player changes color with the "color" command.
+/// Note that the "color" command is always called early on player connection
/// \param[in,out] player Player that requested a new color.
/// \param[in] new_color Requested color.
void SV_ChangeTeam(entity player, int new_color);