* Removes the specified unit from its team. * * @param u The unit to remove from the team it is in. * @return Amount of space left in the team. */
| 554 | * @return Amount of space left in the team. |
| 555 | */ |
| 556 | uint16 Unit_RemoveFromTeam(Unit *u) |
| 557 | { |
| 558 | Team *t; |
| 559 | |
| 560 | if (u == NULL) return 0; |
| 561 | if (u->team == 0) return 0; |
| 562 | |
| 563 | t = Team_Get_ByIndex(u->team - 1); |
| 564 | |
| 565 | t->members--; |
| 566 | u->team = 0; |
| 567 | |
| 568 | return t->maxMembers - t->members; |
| 569 | } |
| 570 | |
| 571 | /** |
| 572 | * Gets the team of the given unit. |
no test coverage detected