handle the client wishing to change teams Usage: "$team " where team_name is the name of the team you want to change to
| 168 | // handle the client wishing to change teams |
| 169 | // Usage: "$team <string team_name>" where team_name is the name of the team you want to change to |
| 170 | void DMFCInputCommand_Team(const char *input_string) { |
| 171 | char team[100]; |
| 172 | |
| 173 | // parse "$team" |
| 174 | if (!StringParseWord(input_string, team, 100, &input_string)) { |
| 175 | basethis->DisplayInputCommandHelp(DTXT_IC_TEAM); |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | // parse team name |
| 180 | if (!StringParseWord(input_string, team, 100, &input_string)) { |
| 181 | basethis->DisplayInputCommandHelp(DTXT_IC_TEAM); |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | int t = basethis->GetTeamFromString(team); |
| 186 | |
| 187 | int curr_team = basethis->Players[basethis->GetPlayerNum()].team; |
| 188 | |
| 189 | if ((t == -1) || (t == curr_team) || (curr_team == -1)) |
| 190 | return; |
| 191 | |
| 192 | mprintf(0, "Attempting to change teams to %s team\n", team); |
| 193 | DLLAddHUDMessage(DTXT_TEAMCHANGEATTEMPT, team); |
| 194 | basethis->RequestTeamChange(t, basethis->GetPlayerNum(), true); |
| 195 | } |
| 196 | |
| 197 | // handle the server wanting to change the team for a player |
| 198 | // Usage: "$changeteam <int pnum> <string team_name>" where pnum is the playernum, and team_name is the name of the |
nothing calls this directly
no test coverage detected