mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
some fixes
This commit is contained in:
1 parent
25c6d66f7e
commit
37cc6cf28b
4 files changed
+19
-13
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
@@ -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) + "<size=0>";
|
||||
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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user