From 02194d819830e0aa920709ecf7672a1ee27d16d1 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Sun, 31 Mar 2019 17:49:13 -0400 Subject: [PATCH] Simplified --- Classic/scripts/autoexec/GetTeamCounts.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Classic/scripts/autoexec/GetTeamCounts.cs b/Classic/scripts/autoexec/GetTeamCounts.cs index 726eb33..a956e7f 100644 --- a/Classic/scripts/autoexec/GetTeamCounts.cs +++ b/Classic/scripts/autoexec/GetTeamCounts.cs @@ -52,16 +52,9 @@ function GetTeamCounts( %game, %client, %respawn ) %client = ClientGroup.getObject(%i); //Pick a client for autobalance - if( %client.team == 1) - { - if(%client.score <= %lastclient1.score || %lastclient1 $= "") $team1canidate = %client; - %lastclient1 = %client; - } - if( %client.team == 2) - { - if(%client.score <= %lastclient2.score || %lastclient2 $= "") $team2canidate = %client; - %lastclient2 = %client; - } + %team = %client.team; + if(%client.score <= %lastclient[%team].score || %lastclient[%team] $= "") %teamcanidate[%team] = %client; + %lastclient[%team] = %client; //Check ver if(!%client.isAIControlled()) //No bots @@ -71,6 +64,9 @@ function GetTeamCounts( %game, %client, %respawn ) $PlayerCount[%client.team]++; } + $team1canidate = %teamcanidate1; + $team2canidate = %teamcanidate2; + //echo ("$PlayerCount[0] " @ $PlayerCount[0]); //echo ("$PlayerCount[1] " @ $PlayerCount[1]); //echo ("$PlayerCount[2] " @ $PlayerCount[2]);