MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / GetTeamCount

Method GetTeamCount

src/lua/LuaCallOuts.cpp:1779–1794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777
1778
1779int LuaCallOuts::GetTeamCount(lua_State* L) {
1780 const TeamColor teamID = ParseTeam(L, 1);
1781 if (teamID == NoTeam) {
1782 return luaL_pushnil(L);
1783 }
1784 World* world = World::getWorld();
1785 if (world == NULL) {
1786 return luaL_pushnil(L);
1787 }
1788 if ((teamID < 0) || (teamID >= NumTeams)) {
1789 return luaL_pushnil(L); // not safe for world->getTeam()
1790 }
1791 const Team& team = world->getTeam(teamID);
1792 lua_pushinteger(L, team.size);
1793 return 1;
1794}
1795
1796
1797int LuaCallOuts::GetTeamScore(lua_State* L) {

Callers

nothing calls this directly

Calls 4

luaL_pushnilFunction · 0.85
ParseTeamFunction · 0.70
lua_pushintegerFunction · 0.50
getTeamMethod · 0.45

Tested by

no test coverage detected