Update CTFGame.cs

Bracket bug
This commit is contained in:
ChocoTaco1 2020-06-30 14:37:44 -04:00
parent c8078e0016
commit 9c1967fd99

View file

@ -648,16 +648,18 @@ function CTFGame::flagCap(%game, %player)
if($Host::ClassicEvoStats) if($Host::ClassicEvoStats)
{ {
%held2 = getSimTime() - %game.totalFlagHeldTime[%flag];
%realtime = %game.formatTime(%held2, true);
%record = false; %record = false;
if($TotalTeamPlayerCount >= $Host::MinFlagRecordPlayerCount)
%recordit = true;
if(%game.totalFlagHeldTime[%flag]) if(%game.totalFlagHeldTime[%flag])
{ {
%held2 = getSimTime() - %game.totalFlagHeldTime[%flag];
%realtime = %game.formatTime(%held2, true);
if(%client.team == 1) if(%client.team == 1)
{ {
if((%held2 < $flagstats::heldTeam1) || $flagstats::heldTeam1 == 0) if((%held2 < $flagstats::heldTeam1) || $flagstats::heldTeam1 == 0)
{ {
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount) if(%recordit)
{ {
$flagstats::heldTeam1 = %held2; $flagstats::heldTeam1 = %held2;
$flagstats::realTeam1 = %realTime; $flagstats::realTeam1 = %realTime;
@ -670,7 +672,7 @@ function CTFGame::flagCap(%game, %player)
{ {
if((%held2 < $flagstats::heldTeam2) || $flagstats::heldTeam2 == 0) if((%held2 < $flagstats::heldTeam2) || $flagstats::heldTeam2 == 0)
{ {
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount) if(%recordit)
{ {
$flagstats::heldTeam2 = %held2; $flagstats::heldTeam2 = %held2;
$flagstats::realTeam2 = %realTime; $flagstats::realTeam2 = %realTime;
@ -682,7 +684,7 @@ function CTFGame::flagCap(%game, %player)
if(%record == true) if(%record == true)
{ {
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount) if(%recordit)
{ {
%fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt"; %fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt";
export("$flagstats::*", %fileOut, false); export("$flagstats::*", %fileOut, false);
@ -691,7 +693,6 @@ function CTFGame::flagCap(%game, %player)
else else
schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players."); schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players.");
} }
}
if(!$Host::TournamentMode) if(!$Host::TournamentMode)
bottomprint(%client, "You captured the flag in " @ %realTime @ " seconds", 3); bottomprint(%client, "You captured the flag in " @ %realTime @ " seconds", 3);
@ -710,6 +711,7 @@ function CTFGame::flagCap(%game, %player)
$stats::fastcap_client = getTaggedString(%client.name); $stats::fastcap_client = getTaggedString(%client.name);
} }
} }
}
//award points to player and team //award points to player and team
%teamName = %game.getTeamName(%flag.team); %teamName = %game.getTeamName(%flag.team);