Skip to content

Commit

Permalink
Fix LastGuard (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS authored Jul 9, 2024
2 parents 7e8a0f5 + 19fee79 commit 24530ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod/Jailbreak.LastGuard/LastGuard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo
private void checkLastGuard(CCSPlayerController? poi)
{
if (poi == null) return;
if (poi.Team != CsTeam.CounterTerrorist) ;
if (poi.Team != CsTeam.CounterTerrorist) return;
var aliveCts = Utilities.GetPlayers()
.Count(plr => plr.IsReal() && plr is { PawnIsAlive: true, Team: CsTeam.CounterTerrorist }) - 1;

if (aliveCts != 1 || lrManager.IsLREnabled) ;
if (aliveCts != 1 || lrManager.IsLREnabled) return;
var lastGuard = Utilities.GetPlayers().First(plr =>
plr.IsReal() && plr != poi && plr is { PawnIsAlive: true, Team: CsTeam.CounterTerrorist });

Expand Down

0 comments on commit 24530ce

Please sign in to comment.