diff --git a/mod/Jailbreak.LastGuard/LastGuard.cs b/mod/Jailbreak.LastGuard/LastGuard.cs index 37ba6f3..af6772c 100644 --- a/mod/Jailbreak.LastGuard/LastGuard.cs +++ b/mod/Jailbreak.LastGuard/LastGuard.cs @@ -163,7 +163,7 @@ public HookResult OnPlayerDeathEvent(EventPlayerDeath @event, var player = @event.Userid; if (player == null) return HookResult.Continue; - Server.NextFrame(() => checkLastGuard(@event.Userid)); + checkLastGuard(@event.Userid); if (!IsLastGuardActive) return HookResult.Continue; diff --git a/mod/Jailbreak.Warden/Global/WardenBehavior.cs b/mod/Jailbreak.Warden/Global/WardenBehavior.cs index 75a6167..2dddd5e 100644 --- a/mod/Jailbreak.Warden/Global/WardenBehavior.cs +++ b/mod/Jailbreak.Warden/Global/WardenBehavior.cs @@ -245,7 +245,7 @@ public bool TryRemoveWarden(bool isPass = false) { logs.Append(logs.Player(Warden), "is no longer the warden."); - if (!isPass && false) { + if (!isPass) { var stats = API.Gangs?.Services.GetService(); if (stats != null) { var wrapper = new PlayerWrapper(Warden); @@ -296,29 +296,21 @@ private async Task updateWardenDeathStats(PlayerWrapper player) { [GameEventHandler] public HookResult OnDeath(EventPlayerDeath ev, GameEventInfo info) { - return HookResult.Continue; var player = ev.Userid; if (player == null || !player.IsValid) return HookResult.Continue; var isWarden = ((IWardenService)this).IsWarden(player); - if (API.Gangs != null && false) { - Server.PrintToConsole("WardenBehavior: OnDeath"); + if (API.Gangs != null) { if (ev.Attacker != null && ev.Attacker.IsValid && ev.Attacker != player && isWarden) { - Server.PrintToConsole("WardenBehavior: OnDeath: Attacker is valid"); var wrapper = new PlayerWrapper(ev.Attacker); Task.Run(async () => await incrementWardenKills(wrapper)); } - Server.PrintToConsole( - "WardenBehavior: OnDeath: Updating guard death stats"); foreach (var guard in PlayerUtil.FromTeam(CsTeam.CounterTerrorist)) { - Server.PrintToConsole($"WardenBehavior: OnDeath: Guard: {guard}"); var wrapper = new PlayerWrapper(guard); // If the guard is the warden, update all guards' stats // If the guard is not the warden, only update the warden's stats if (guard.SteamID == player.SteamID != isWarden) continue; - Server.PrintToConsole( - $"WardenBehavior: OnDeath: Guard: {guard} is the warden"); Task.Run(async () => await updateGuardDeathStats(wrapper, isWarden)); } }