mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
1 parent
0c590ad263
commit
2141a2c15f
2 files changed
+24
-28
No files matched your search
@@ -70,7 +70,7 @@ class PlayerControlPatch
|
||||
|
||||
public static void SetPlayerInfo(PlayerControl player)
|
||||
{
|
||||
if (player == null || player.Data == null) return;
|
||||
if (player == null) return;
|
||||
|
||||
// Set player text info
|
||||
if (player.DataIsCollected() != true)
|
||||
@@ -203,7 +203,7 @@ class PlayerControlPatch
|
||||
string Role = $"<color={player.GetTeamHexColor()}>{player.GetRoleName()}</color>";
|
||||
if (!player.IsImpostorTeammate())
|
||||
{
|
||||
if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.IsAlive() && player != PlayerControl.LocalPlayer)
|
||||
if (PlayerControl.LocalPlayer.IsAlive() && player != PlayerControl.LocalPlayer)
|
||||
{
|
||||
if (!DebugMenu.RevealRoles)
|
||||
{
|
||||
|
||||
@@ -10,34 +10,30 @@ class OnGameJoinedPatch
|
||||
{
|
||||
public static void Postfix(/*AmongUsClient __instance*/)
|
||||
{
|
||||
try
|
||||
PlayerControlPatch.infotime = 0f;
|
||||
|
||||
AntiCheat.PauseAntiCheat();
|
||||
|
||||
// Fix host icon in lobby on modded servers
|
||||
if (!GameStates.IsVanillaServer)
|
||||
{
|
||||
PlayerControlPatch.infotime = 0f;
|
||||
|
||||
AntiCheat.PauseAntiCheat();
|
||||
|
||||
// Fix host icon in lobby on modded servers
|
||||
if (!GameStates.IsVanillaServer)
|
||||
{
|
||||
var host = AmongUsClient.Instance.GetHost().Character;
|
||||
host.SetColor(-2);
|
||||
host.SetColor(host.CurrentOutfit.ColorId);
|
||||
}
|
||||
|
||||
_ = new LateTask(() =>
|
||||
{
|
||||
// Send Better Among Us Check RPC
|
||||
if (GameStates.IsInGame)
|
||||
{
|
||||
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.BetterCheck, SendOption.None, -1);
|
||||
messageWriter.Write((byte)PlayerControl.LocalPlayer.NetId);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
|
||||
}
|
||||
}, 1.5f, "OnGameJoinedPatch");
|
||||
|
||||
Logger.Log($"Successfully joined {GameCode.IntToGameName(AmongUsClient.Instance.GameId)}", "OnGameJoinedPatch");
|
||||
var host = AmongUsClient.Instance.GetHost().Character;
|
||||
host.SetColor(-2);
|
||||
host.SetColor(host.CurrentOutfit.ColorId);
|
||||
}
|
||||
catch { };
|
||||
|
||||
_ = new LateTask(() =>
|
||||
{
|
||||
// Send Better Among Us Check RPC
|
||||
if (GameStates.IsInGame)
|
||||
{
|
||||
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.BetterCheck, SendOption.None, -1);
|
||||
messageWriter.Write((byte)PlayerControl.LocalPlayer.NetId);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
|
||||
}
|
||||
}, 1.5f, "OnGameJoinedPatch");
|
||||
|
||||
Logger.Log($"Successfully joined {GameCode.IntToGameName(AmongUsClient.Instance.GameId)}", "OnGameJoinedPatch");
|
||||
}
|
||||
}
|
||||
[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnPlayerJoined))]
|
||||
|
||||
Reference in new issue
Block a user