Skip to content

Commit

Permalink
bug: make sure the person belongs to the team before auto picking the…
Browse files Browse the repository at this point in the history
… captain
  • Loading branch information
lukepolo committed Oct 18, 2024
1 parent 22cad73 commit 68598cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FiveStack.Services/CaptainSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public bool IsCaptain(CCSPlayerController player, CsTeam team)
return false;
}

if (player.Team != team)
{
return false;
}

MatchData? matchData = _matchService.GetCurrentMatch()?.GetMatchData();
if (matchData != null)
{
Expand Down
2 changes: 2 additions & 0 deletions src/FiveStack.Services/KnifeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public void Switch(CCSPlayerController player)
return;
}

_logger.LogInformation($"Knife round winning team: {winningTeam}");

if (match.captainSystem.IsCaptain(player, winningTeam) == false)
{
_gameServer.Message(
Expand Down

0 comments on commit 68598cd

Please sign in to comment.