From a3b891f906e595e5c3c02e54c8a003cc5719ece9 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Sat, 24 May 2025 15:57:42 +0200 Subject: [PATCH] a --- Modules/AntiBlackout.cs | 13 ++++--------- Modules/CustomRpcSender.cs | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Modules/AntiBlackout.cs b/Modules/AntiBlackout.cs index bf19807cf..201728b48 100644 --- a/Modules/AntiBlackout.cs +++ b/Modules/AntiBlackout.cs @@ -171,6 +171,7 @@ public static class AntiBlackout { if (!pc.IsAlive()) { + pc.Exiled(); sender.AutoStartRpc(pc.NetId, (byte)RpcCalls.Exiled); sender.EndRpc(); hasValue = true; @@ -178,7 +179,7 @@ public static class AntiBlackout } sender.SendMessage(!hasValue); - }, 0.3f, "AntiBlackout.AfterMeetingTasks"); + }, 0.3f + Utils.CalculatePingDelay(), "AntiBlackout.AfterMeetingTasks"); } catch (Exception e) { Utils.ThrowException(e); } } @@ -225,20 +226,14 @@ public static class AntiBlackout changedRoleType = roletype is RoleTypes.Impostor or RoleTypes.Shapeshifter or RoleTypes.Phantom ? RoleTypes.ImpostorGhost : RoleTypes.CrewmateGhost; } - if (seer.AmOwner) - { - target.SetRole(changedRoleType); - continue; - } - - senders[seer.PlayerId].RpcSetRole(target, changedRoleType, seer.OwnerId, noRpcForSelf: false); - hasValue[seer.PlayerId] = true; + hasValue[seer.PlayerId] = senders[seer.PlayerId].RpcSetRole(target, changedRoleType, seer.OwnerId); RestartMessageIfTooLong(seer.PlayerId); } foreach (PlayerControl pc in selfExiled) { CustomRpcSender sender = senders[byte.MaxValue]; + pc.Exiled(); sender.AutoStartRpc(pc.NetId, (byte)RpcCalls.Exiled); sender.EndRpc(); hasValue[byte.MaxValue] = true; diff --git a/Modules/CustomRpcSender.cs b/Modules/CustomRpcSender.cs index a72c483b5..28588dac8 100644 --- a/Modules/CustomRpcSender.cs +++ b/Modules/CustomRpcSender.cs @@ -593,7 +593,7 @@ public static class CustomRpcSenderExtensions player.Exiled(); sender.AutoStartRpc(player.NetId, (byte)RpcCalls.Exiled); sender.EndRpc(); - FixedUpdatePatch.LoversSuicide(player.PlayerId); + LateTask.New(() => FixedUpdatePatch.LoversSuicide(player.PlayerId), Utils.CalculatePingDelay() * 2f, log: false); } public static bool Notify(this CustomRpcSender sender, PlayerControl pc, string text, float time = 6f, bool overrideAll = false, bool log = true, bool setName = true)