From 37cc6cf28bb177351366b607e683de0dad3e0c29 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Wed, 20 May 2026 17:49:09 +0200 Subject: [PATCH] some fixes --- Patches/ExilePatch.cs | 15 +++++++++++++++ Patches/MeetingHudPatch.cs | 13 +------------ Patches/PlayerJoinAndLeftPatch.cs | 2 +- Roles/Standard/Impostor/Concealing/Duellist.cs | 2 ++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index a0deb6502..0b764357e 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -1,3 +1,4 @@ +using System; using System.Diagnostics; using System.Linq; using System.Reflection; @@ -95,6 +96,20 @@ internal static class ExileControllerWrapUpPatch Main.EnumerateAlivePlayerControls().Do(map.RandomTeleport); } + try + { + foreach ((byte id, Vector2 pos) in Lazy.BeforeMeetingPositions) + { + PlayerControl pc = id.GetPlayer(); + if (!pc || !pc.IsAlive()) continue; + + pc.TP(pos); + } + } + catch (Exception e) { Utils.ThrowException(e); } + + Lazy.BeforeMeetingPositions = []; + FallFromLadder.Reset(); Utils.CountAlivePlayers(true); diff --git a/Patches/MeetingHudPatch.cs b/Patches/MeetingHudPatch.cs index 4d14a1ae6..2b8d6bed6 100644 --- a/Patches/MeetingHudPatch.cs +++ b/Patches/MeetingHudPatch.cs @@ -363,7 +363,7 @@ internal static class CheckForEndVotingPatch { if (!AmongUsClient.Instance.AmHost) return; - if (exiledPlayer == null) return; + if (!exiledPlayer) return; byte exileId = exiledPlayer.PlayerId; if (exileId > 254) return; @@ -536,17 +536,6 @@ internal static class CheckForEndVotingPatch name = name.Replace("color=", string.Empty) + ""; TempExiledPlayer = exiledPlayer; EjectionText = name; - - LateTask.New(() => - { - foreach ((byte id, Vector2 pos) in Lazy.BeforeMeetingPositions) - { - PlayerControl pc = id.GetPlayer(); - if (!pc || !pc.IsAlive()) continue; - - pc.TP(pos); - } - }, 12f, "Teleport Lazy Players"); } public static bool CheckRole(byte id, CustomRoles role) diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 78545fbb3..e1af3c6ca 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -532,7 +532,7 @@ internal static class OnPlayerJoinedPatch if (GameStates.IsLobby && !OnGameJoinedPatch.JoiningGame) LateTask.New(Options.AutoSetFactionMinMaxSettings, 2f, log: false); - LateTask.New(() => Utils.DirtyName.Add(PlayerControl.LocalPlayer.PlayerId), 1.5f); + LateTask.New(() => Utils.DirtyName.Add(PlayerControl.LocalPlayer.PlayerId), 2f); } } } diff --git a/Roles/Standard/Impostor/Concealing/Duellist.cs b/Roles/Standard/Impostor/Concealing/Duellist.cs index 08bcc0d10..13a43e54a 100644 --- a/Roles/Standard/Impostor/Concealing/Duellist.cs +++ b/Roles/Standard/Impostor/Concealing/Duellist.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; +using UnityEngine; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; @@ -81,6 +82,7 @@ public class Duellist : RoleBase IEnumerator Coroutine() { while (GameStates.IsInTask && duellist.IsAlive() && target.IsAlive()) yield return null; + yield return new WaitForSecondsRealtime(1f); if (!GameStates.IsInTask) yield break; DuelPair.Remove(duellist.PlayerId);