Skip to content

Commit

Permalink
Added GetActiveTeams()
Browse files Browse the repository at this point in the history
  • Loading branch information
YoYo178 committed Jun 25, 2024
1 parent b6aa129 commit ae334de
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions maps/includes/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,18 @@ function NormalizeInt(x)

if ( math.ceil( x ) - x ) > 0.5 then return math.floor( x )
else return math.ceil( x ) end
end

function GetActiveTeams()
local o = {}

for i = Team.kUnassigned, Team.kGreen do
local team = GetTeam(i)

if not team then return end

if team:GetPlayerLimit() ~= -1 then table.insert(o, team) end
end

return o
end

0 comments on commit ae334de

Please sign in to comment.