MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Unit_AddToTeam

Function Unit_AddToTeam

src/unit.c:540–548  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

538 * @return Amount of space left in the team.
539 */
540uint16 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.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected