mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-03-06 05:00:21 +00:00
Reverted
This commit is contained in:
parent
b2af77f9de
commit
81c80b0ef1
1 changed files with 5 additions and 41 deletions
|
|
@ -41,25 +41,9 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
//Toggle for All Mode
|
||||
//If a team is behind pick anyone, not just a low scoring player
|
||||
if( $TeamScore[%bigTeam] > ($TeamScore[%littleTeam] + $AllModeThreshold))
|
||||
%UseAllMode = 1;
|
||||
|
||||
if(%UseAllMode)
|
||||
{
|
||||
//We need to find out how many people are on a team holding flags and in vehicles to make the proper exceptions in the loop
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%team = %client.team;
|
||||
|
||||
if(%team $= %bigTeam)
|
||||
{
|
||||
//Holding flag? In a Vehicle?
|
||||
if(%client.player.holdingFlag !$= "" || isObject(%client.vehicleMounted))
|
||||
%exceptioncount++;
|
||||
}
|
||||
}
|
||||
|
||||
%autobalanceRandom = getRandom(1,($TeamRank[%bigTeam, count] - %exceptioncount));
|
||||
%UseAllMode = 1;
|
||||
%autobalanceRandom = getRandom(1,($TeamRank[%bigTeam, count] - 1));
|
||||
}
|
||||
|
||||
//Pick a client for autobalance
|
||||
|
|
@ -70,8 +54,8 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
|
||||
if(%team $= %bigTeam)
|
||||
{
|
||||
//Holding flag? In a Vehicle?
|
||||
if(%client.player.holdingFlag !$= "" || isObject(%client.vehicleMounted))
|
||||
//Holding flag?
|
||||
if(%client.player.holdingFlag !$= "")
|
||||
continue;
|
||||
|
||||
if(%UseAllMode)
|
||||
|
|
@ -84,6 +68,7 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
}
|
||||
else
|
||||
{
|
||||
//Normal circumstances
|
||||
//Try to pick a low scoring player
|
||||
if(%client.score < %lastclient[%team].score || %lastclient[%team] $= "")
|
||||
%teamcanidate[%team] = %client;
|
||||
|
|
@ -91,27 +76,6 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
%lastclient[%team] = %client;
|
||||
}
|
||||
}
|
||||
|
||||
//A situation where the whole team is in vehicles or holding a flag
|
||||
//Pick anyone
|
||||
if(%teamcanidate[%bigTeam] $= "")
|
||||
{
|
||||
//Pick a client for autobalance
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%team = %client.team;
|
||||
|
||||
if(%team $= %bigTeam)
|
||||
{
|
||||
//Try to pick a low scoring player
|
||||
if(%client.score < %lastclient[%team].score || %lastclient[%team] $= "")
|
||||
%teamcanidate[%team] = %client;
|
||||
|
||||
%lastclient[%team] = %client;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Debug
|
||||
if( %AutobalanceDebug )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue