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

Method GetTeamScore

src/lua/LuaCallOuts.cpp:1797–1813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1795
1796
1797int LuaCallOuts::GetTeamScore(lua_State* L) {
1798 const TeamColor teamID = ParseTeam(L, 1);
1799 if (teamID == NoTeam) {
1800 return luaL_pushnil(L);
1801 }
1802 World* world = World::getWorld();
1803 if (world == NULL) {
1804 return luaL_pushnil(L);
1805 }
1806 if ((teamID < 0) || (teamID > NumTeams)) {
1807 return luaL_pushnil(L); // not safe for world->getTeam()
1808 }
1809 const Team& team = world->getTeam(teamID);
1810 lua_pushinteger(L, team.won);
1811 lua_pushinteger(L, team.lost);
1812 return 2;
1813}
1814
1815
1816int LuaCallOuts::GetTeamColor(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