Skip to content

Commit

Permalink
Fix DI again
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Feb 19, 2024
1 parent e99bbdb commit 67b6ba8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mod/Jailbreak.LastRequest/LastRequestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void Command_LastRequest(CCSPlayerController? executor, CommandInfo info)
}

// Validate LR
LRType? type = LRTypeExtensions.FromString(info.GetArg(1));
var type = LRTypeExtensions.FromString(info.GetArg(1));
if (type == null)
{
info.ReplyToCommand("Invalid LR");
Expand All @@ -78,6 +78,7 @@ public void Command_LastRequest(CCSPlayerController? executor, CommandInfo info)
}

var target = info.GetArgTargetResult(2);
new Target(info.GetArg(2)).GetTarget(executor);
if (!target.Players.Any())
{
info.ReplyToCommand($"Could not find valid player using {info.GetArg(2)}");
Expand Down
2 changes: 1 addition & 1 deletion mod/Jailbreak.LastRequest/LastRequestFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class LastRequestFactory : ILastRequestFactory

public void Start(BasePlugin parent)
{
this.plugin = plugin;
plugin = parent;
}

public AbstractLastRequest CreateLastRequest(CCSPlayerController prisoner, CCSPlayerController guard, LRType type)
Expand Down
2 changes: 1 addition & 1 deletion mod/Jailbreak.LastRequest/LastRequestPlayerSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public CenterHtmlMenu CreateMenu(CCSPlayerController player, LRType lrType)

private void OnSelect(CCSPlayerController player, ChatMenuOption option, LRType lr, CCSPlayerController target)
{
player.ExecuteClientCommandFromServer("css_lr " + ((int) lr) + " #" + target.Index);
player.ExecuteClientCommandFromServer("css_lr " + ((int) lr) + " #" + target.UserId);
}
}
4 changes: 2 additions & 2 deletions mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public KnifeFight(BasePlugin plugin, CCSPlayerController prisoner, CCSPlayerCont

public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)
{
if (@event.Userid != prisoner && @event.Userid != guard)
if (@event.Userid.Slot != prisoner.Slot && @event.Userid.Slot != guard.Slot)
return HookResult.Continue;

if (@event.Userid == prisoner)
if (@event.Userid.Slot == prisoner.Slot)
End(LRResult.GuardWin);
else
End(LRResult.PrisonerWin);
Expand Down

0 comments on commit 67b6ba8

Please sign in to comment.