mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fix
This commit is contained in:
1 parent
e7f9faeeca
commit
608dc3f644
3 files changed
+8
-9
No files matched your search
@@ -194,7 +194,9 @@ public class CustomLogger
|
||||
public void Log(string level, string message, bool multiLine = false)
|
||||
{
|
||||
if (multiLine) message = message.Replace("\\n", "<br>");
|
||||
|
||||
if (message.Contains("<b>")) message += "</b>";
|
||||
if (message.Contains("<u>")) message += "</u>";
|
||||
|
||||
string logEntry = $"""
|
||||
<div class='log-entry {level.ToLower()}'>
|
||||
|
||||
+5
-7
@@ -89,7 +89,7 @@ internal static class EAC
|
||||
Logger.Fatal($"Player [{pc.GetClientId()}:{pc.GetRealName()}] attempted to report a body that may have been illegally killed, but was rejected", "EAC");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (GameManager.Instance.TryCast<HideAndSeekManager>())
|
||||
{
|
||||
WarnHost();
|
||||
@@ -98,10 +98,11 @@ internal static class EAC
|
||||
Logger.Fatal($"Player [{pc.GetClientId()}:{pc.GetRealName()}] attempted to report a body in Hide and Seek, rejected", "EAC");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (targetId != byte.MaxValue)
|
||||
{
|
||||
bool bodyExists = Object.FindObjectsOfType<DeadBody>().Any(deadBody => deadBody.ParentId == targetId);
|
||||
|
||||
if (!bodyExists && targetId != pc.PlayerId && (!MeetingHud.Instance || MeetingHud.Instance.state != MeetingHud.VoteStates.Animating))
|
||||
{
|
||||
WarnHost();
|
||||
@@ -307,10 +308,7 @@ internal static class EAC
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Exception(e, "EAC");
|
||||
}
|
||||
catch (Exception e) { Logger.Exception(e, "EAC"); }
|
||||
|
||||
WarnHost(-1);
|
||||
return false;
|
||||
@@ -495,7 +493,7 @@ internal static class EAC
|
||||
|
||||
internal static bool CheckInvalidSabotage(SystemTypes systemType, PlayerControl player, byte amount)
|
||||
{
|
||||
if (player.IsHost()) return false;
|
||||
if (player.IsHost() || !AmongUsClient.Instance.AmHost) return false;
|
||||
|
||||
if ((GameStates.IsMeeting && MeetingHud.Instance.state != MeetingHud.VoteStates.Animating) || ExileController.Instance)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ using Exception = System.Exception;
|
||||
namespace EHR;
|
||||
|
||||
[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.CoStartGame))]
|
||||
internal class ChangeRoleSettings
|
||||
internal static class ChangeRoleSettings
|
||||
{
|
||||
public static bool Prefix(AmongUsClient __instance)
|
||||
{
|
||||
@@ -301,7 +301,6 @@ internal class ChangeRoleSettings
|
||||
if (AmongUsClient.Instance.AmHost && Options.FormatNameMode.GetInt() == 1) pc.RpcSetName(Palette.GetColorName(colorId));
|
||||
|
||||
Main.PlayerStates[pc.PlayerId] = new(pc.PlayerId);
|
||||
Main.PlayerColors[pc.PlayerId] = Palette.PlayerColors[colorId];
|
||||
Main.AllPlayerSpeed[pc.PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod);
|
||||
Main.AllPlayerKillCooldown[pc.PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.KillCooldown);
|
||||
ReportDeadBodyPatch.CanReport[pc.PlayerId] = true;
|
||||
|
||||
Reference in new issue
Block a user