Skip to content

Commit

Permalink
Fixed team joining bug
Browse files Browse the repository at this point in the history
B3none committed Jan 21, 2024
1 parent 8787430 commit b7faf3f
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Modules/Managers/QueueManager.cs
Original file line number Diff line number Diff line change
@@ -40,10 +40,7 @@ public HookResult PlayerJoinedTeam(CCSPlayerController player, CsTeam fromTeam,
{
Console.WriteLine($"{RetakesPlugin.LogPrefix}[{player.PlayerName}] PlayerTriedToJoinTeam called.");

if (
fromTeam == CsTeam.None && toTeam == CsTeam.Spectator
|| fromTeam == CsTeam.Spectator && toTeam == CsTeam.None
)
if (fromTeam == CsTeam.None && toTeam == CsTeam.Spectator)
{
// This is called when a player first joins.
Console.WriteLine(
7 changes: 1 addition & 6 deletions RetakesPlugin.cs
Original file line number Diff line number Diff line change
@@ -654,18 +654,13 @@ private HookResult OnCommandJoinTeam(CCSPlayerController? player, CommandInfo co
return HookResult.Continue;
}

if (Helpers.GetGameRules().WarmupPeriod)
{
Console.WriteLine($"{LogPrefix}Warmup round, skipping.");
return HookResult.Continue;
}

if (
!Helpers.IsValidPlayer(player)
|| commandInfo.ArgCount < 2
|| !Enum.TryParse<CsTeam>(commandInfo.GetArg(1), out var toTeam)
)
{
Console.WriteLine("RETURNING EARLY, NOT VALID OR NOT ENOUGH ARGS");
return HookResult.Handled;
}

0 comments on commit b7faf3f

Please sign in to comment.