* Gets the team of the given unit. * * @param u The unit to get the team of. * @return The team. */
| 575 | * @return The team. |
| 576 | */ |
| 577 | Team *Unit_GetTeam(Unit *u) |
| 578 | { |
| 579 | if (u == NULL) return NULL; |
| 580 | if (u->team == 0) return NULL; |
| 581 | return Team_Get_ByIndex(u->team - 1); |
| 582 | } |
| 583 | |
| 584 | /** |
| 585 | * ?? Sorts unit array and count enemy/allied units. |
no test coverage detected