Skip to content

Commit

Permalink
Fix circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Nov 1, 2024
1 parent 85cf6d5 commit a649be7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mod/Jailbreak.LastRequest/LastRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

namespace Jailbreak.LastRequest;

public class LastRequestManager(ILRLocale messages, IServiceProvider provider,
ILastGuardService lastGuard, IRebelService rebel)
public class LastRequestManager(ILRLocale messages, IServiceProvider provider)
: ILastRequestManager, IDamageBlocker {
public static readonly FakeConVar<int> CV_LR_BASE_TIME =
new("css_jb_lr_time_base",
Expand Down Expand Up @@ -123,7 +122,9 @@ public void EnableLR(CCSPlayerController? died = null) {

RoundUtil.AddTimeRemaining(CV_LR_GUARD_TIME.Value * cts);

var players = Utilities.GetPlayers();
var players = Utilities.GetPlayers();
var lastGuard = provider.GetService<ILastGuardService>();
var rebel = provider.GetService<IRebelService>();
foreach (var player in players) {
player.ExecuteClientCommand("play sounds/lr");
var wrapper = new PlayerWrapper(player);
Expand All @@ -150,7 +151,7 @@ public void EnableLR(CCSPlayerController? died = null) {
if (player.Team != CsTeam.Terrorist) continue;
if (died != null && player.SteamID == died.SteamID) continue;

if (lastGuard.IsLastGuardActive) rebel.UnmarkRebel(player);
if (lastGuard is { IsLastGuardActive: true }) rebel?.UnmarkRebel(player);
player.ExecuteClientCommandFromServer("css_lr");
}

Expand Down

0 comments on commit a649be7

Please sign in to comment.