| 1795 | |
| 1796 | |
| 1797 | int 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 | |
| 1816 | int LuaCallOuts::GetTeamColor(lua_State* L) { |
nothing calls this directly
no test coverage detected