Skip to content

Commit

Permalink
Fix multiple possible issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Feb 19, 2024
1 parent 1cea2f2 commit e99bbdb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion mod/Jailbreak.LastRequest/LastRequestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ public void Command_LastRequest(CCSPlayerController? executor, CommandInfo info)
var player = target.Players.First();
if (player.Team != CsTeam.CounterTerrorist)
{
info.ReplyToCommand("Invalid player");
info.ReplyToCommand("They're not on CT!");
return;
}

if (!player.PawnIsAlive)
{
info.ReplyToCommand("They're not alive!");
return;
}

Expand Down
3 changes: 2 additions & 1 deletion mod/Jailbreak.LastRequest/LastRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info)
if (CountAlivePrisoners() > config.PrisonersToActiveLR)
return HookResult.Continue;
this.IsLREnabled = true;
messages.LastRequestEnabled().ToAllChat();
return HookResult.Continue;
}

Expand All @@ -57,7 +58,7 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)
if (player.GetTeam() != CsTeam.Terrorist)
return HookResult.Continue;

if (CountAlivePrisoners() > config.PrisonersToActiveLR)
if (CountAlivePrisoners() - 1> config.PrisonersToActiveLR)
return HookResult.Continue;

IsLREnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface ILastRequestManager : IPluginBehavior
public bool IsLREnabled { get; set; }
public IList<AbstractLastRequest> ActiveLRs { get; }

void InitiateLastRequest(CCSPlayerController guard, CCSPlayerController prisoner, LRType lrType);
void InitiateLastRequest(CCSPlayerController prisoner, CCSPlayerController guard, LRType lrType);

public bool IsInLR(CCSPlayerController player)
{
Expand Down

0 comments on commit e99bbdb

Please sign in to comment.