- case NUM_TEAM_1:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 1))
- {
- LOG_INFO("Sorry, can't move player to red team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_2:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 2))
- {
- LOG_INFO("Sorry, can't move player to blue team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_3:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 3))
- {
- LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- case NUM_TEAM_4:
- {
- if (!TeamBalance_IsTeamAllowed(balance, 4))
- {
- LOG_INFO("Sorry, can't move player to pink team if it doesn't exist.");
- TeamBalance_Destroy(balance);
- return;
- }
- TeamBalance_Destroy(balance);
- break;
- }
- default:
- {
- LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
- return;
- }
+ LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
+ TeamBalance_Destroy(balance);
+ return;
+ }
+ if (!TeamBalance_IsTeamAllowed(balance, real_team_id))
+ {
+ LOG_INFOF("Sorry, can't move player to %s team if it doesn't exist.", destination);
+ TeamBalance_Destroy(balance);
+ return;