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

Function Unit_RemoveFromTeam

src/unit.c:556–569  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

554 * @return Amount of space left in the team.
555 */
556uint16 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.

Callers 4

Map_MakeExplosionFunction · 0.85
Unit_UntargetMeFunction · 0.85
Unit_RemovePlayerFunction · 0.85

Calls 1

Team_Get_ByIndexFunction · 0.85

Tested by

no test coverage detected