* Adds the specified unit to the specified team. * * @param u The unit to add to the team. * @param t The team to add the unit to. * @return Amount of space left in the team. */
| 538 | * @return Amount of space left in the team. |
| 539 | */ |
| 540 | uint16 Unit_AddToTeam(Unit *u, Team *t) |
| 541 | { |
| 542 | if (t == NULL || u == NULL) return 0; |
| 543 | |
| 544 | u->team = t->index + 1; |
| 545 | t->members++; |
| 546 | |
| 547 | return t->maxMembers - t->members; |
| 548 | } |
| 549 | |
| 550 | /** |
| 551 | * Removes the specified unit from its team. |
no outgoing calls
no test coverage detected