Skip to content

Commit 63b61cf

Browse files
committed
Return randomization
1 parent e50db9f commit 63b61cf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • addons/sourcemod/scripting/mitm

addons/sourcemod/scripting/mitm/util.sp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,13 @@ static int SortDefendersByPriority(int index1, int index2, Handle array, Handle
426426
CTFPlayer player1 = list.Get(index1);
427427
CTFPlayer player2 = list.Get(index2);
428428

429+
// Sort by highest connection time
429430
int c = Compare(player2.GetDefenderPriority(), player1.GetDefenderPriority());
430431

431-
// Sort by highest connection time
432+
// Sort randomly
432433
if (c == 0)
433434
{
434-
c = Compare(player2.GetTimeConnected(), player1.GetTimeConnected());
435+
c = GetRandomInt(0, 1) ? -1 : 1;
435436
}
436437

437438
return c;

0 commit comments

Comments
 (0)