diff --git a/Gamemodes/BedWars.cs b/Gamemodes/BedWars.cs index 17900b0f0..1ca4565b5 100644 --- a/Gamemodes/BedWars.cs +++ b/Gamemodes/BedWars.cs @@ -851,7 +851,7 @@ public static class BedWars NameNotifyManager.Notifies.Remove(pc.PlayerId); RPC.PlaySoundRPC(pc.PlayerId, Sounds.TaskComplete); pc.ReviveFromTemporaryExile(); - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor(Team.GetColorId()); + pc.RpcChangeColor(Team.GetColorId()); pc.TP(Base.SpawnPosition); pc.SetChatVisible(true); Utils.NotifyRoles(SpecifyTarget: pc, SendOption: SendOption.None); diff --git a/Gamemodes/CaptureTheFlag.cs b/Gamemodes/CaptureTheFlag.cs index 175fd273d..369547b26 100644 --- a/Gamemodes/CaptureTheFlag.cs +++ b/Gamemodes/CaptureTheFlag.cs @@ -363,8 +363,6 @@ public static class CaptureTheFlag int blueCount = players.Count / 2; HashSet bluePlayers = []; HashSet yellowPlayers = []; - - bool vanillaServer = GameStates.CurrentServerType == GameStates.ServerType.Vanilla; for (var i = 0; i < blueCount; i++) { @@ -372,7 +370,7 @@ public static class CaptureTheFlag players.Remove(player); PlayerTeams[player.PlayerId] = CTFTeam.Blue; bluePlayers.Add(player.PlayerId); - if (!vanillaServer) player.RpcSetColor(1); + player.RpcChangeColor(1); yield return WaitFrameIfNecessary(); } @@ -380,7 +378,7 @@ public static class CaptureTheFlag { PlayerTeams[player.PlayerId] = CTFTeam.Yellow; yellowPlayers.Add(player.PlayerId); - if (!vanillaServer) player.RpcSetColor(5); + player.RpcChangeColor(5); yield return WaitFrameIfNecessary(); } diff --git a/Gamemodes/KingOfTheZones.cs b/Gamemodes/KingOfTheZones.cs index bcd9203bc..6e952b2c2 100644 --- a/Gamemodes/KingOfTheZones.cs +++ b/Gamemodes/KingOfTheZones.cs @@ -972,19 +972,13 @@ public static class KingOfTheZones yield return null; - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) + foreach (PlayerControl player in Main.EnumerateAlivePlayerControls()) { - foreach (PlayerControl player in Main.EnumerateAlivePlayerControls()) + try { - try - { - byte colorId = PlayerTeams[player.PlayerId].GetColorId(); - if (player.CurrentOutfit.ColorId == colorId) continue; - - player.RpcSetColor(colorId); - } - catch (Exception e) { Utils.ThrowException(e); } + player.RpcChangeColor(PlayerTeams[player.PlayerId].GetColorId()); } + catch (Exception e) { Utils.ThrowException(e); } } yield return null; diff --git a/Gamemodes/LoopWanted.cs b/Gamemodes/LoopWanted.cs index 918b73af2..9d7eb290d 100644 --- a/Gamemodes/LoopWanted.cs +++ b/Gamemodes/LoopWanted.cs @@ -305,10 +305,10 @@ internal static class LoopWanted Suffix.Clear(); - Suffix.Append(""); + Suffix.Append("<#D9BAA5>"); Suffix.Append(hud ? GetString("LoopWanted.CurrentTarget") : GetString("Target")); - Suffix.Append(": "); - Suffix.Append(Main.AllPlayerNames.GetValueOrDefault(targetId, GetString("Unknown"))); + Suffix.Append(": "); + Suffix.Append(targetId.ColoredPlayerName()); Suffix.Append(""); if (ShowTargetArrow.GetBool()) @@ -317,9 +317,11 @@ internal static class LoopWanted Suffix.Append(TargetArrow.GetArrows(seer, targetId)); } + Suffix.Append(""); + if (CarnivalMode) { - Suffix.Append("\n"); + Suffix.Append("\n<#ff6600>"); Suffix.Append(GetString("LoopWanted.CarnivalModeHUD")); Suffix.Append(""); } diff --git a/Modules/Camouflage.cs b/Modules/Camouflage.cs index 67ab40f60..fc934b95b 100644 --- a/Modules/Camouflage.cs +++ b/Modules/Camouflage.cs @@ -4,6 +4,7 @@ using AmongUs.Data; using EHR.Modules; using EHR.Roles; using Hazel; +using UnityEngine; namespace EHR; @@ -151,15 +152,15 @@ public static class Camouflage RpcSetSkin(pc); - yield return null; + yield return new WaitForSecondsRealtime(0.1f); } + yield return new WaitForSecondsRealtime(0.5f); yield return Utils.NotifyEveryoneAsync(); } public static void RpcSetSkin(PlayerControl target, bool forceRevert = false, bool revertToDefault = false, bool gameEnd = false, bool revive = false, bool notCommsOrCamo = false, CustomRpcSender sender = null) { - if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return; if (!AmongUsClient.Instance.AmHost || (!Options.CommsCamouflage.GetBool() && !Camouflager.On && !revive && !notCommsOrCamo) || !target || (BlockCamouflage && !forceRevert && !revertToDefault && !gameEnd && !revive && !notCommsOrCamo)) return; Logger.Info($"New outfit for {target.GetNameWithRole()}", "Camouflage.RpcSetSkin"); @@ -216,6 +217,12 @@ public static class Camouflage Logger.Info($"Setting new outfit: {newOutfit.GetString()}", "Camouflage.RpcSetSkin"); + if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) + { + target.RpcChangeOutfitByData(newOutfit); + return; + } + bool noSender = sender == null; if (noSender) sender = CustomRpcSender.Create($"Camouflage.RpcSetSkin({target.Data.PlayerName})", SendOption.Reliable); WriteToSender(sender, target, newOutfit); diff --git a/Modules/CustomRoleSelector.cs b/Modules/CustomRoleSelector.cs index e569320d0..a039587be 100644 --- a/Modules/CustomRoleSelector.cs +++ b/Modules/CustomRoleSelector.cs @@ -104,7 +104,7 @@ internal static class CustomRoleSelector switch (role) { - case CustomRoles.Camouflager or CustomRoles.Magistrate or CustomRoles.Devourer or CustomRoles.Venerer or CustomRoles.Amogus or CustomRoles.Shadow or CustomRoles.MoonDancer or CustomRoles.Merchant or CustomRoles.Catalyst or CustomRoles.Doppelganger or CustomRoles.Butcher when GameStates.CurrentServerType == GameStates.ServerType.Vanilla: + case CustomRoles.Butcher when GameStates.CurrentServerType == GameStates.ServerType.Vanilla: case CustomRoles.Bargainer when Main.LIMap: case CustomRoles.AntiAdminer when Main.LIMap: case CustomRoles.CameraMan when Main.LIMap: @@ -571,7 +571,6 @@ internal static class CustomRoleSelector switch (role) { - case CustomRoles.Disco or CustomRoles.BananaMan or CustomRoles.Hidden or CustomRoles.Concealer when GameStates.CurrentServerType == GameStates.ServerType.Vanilla: case CustomRoles.Concealer or CustomRoles.Hidden when Options.AnonymousBodies.GetBool(): case CustomRoles.Autopsy when Options.EveryoneSeesDeathReasons.GetBool(): case CustomRoles.Gravestone when Options.EveryoneSeesDeadPlayersRoles.GetBool(): diff --git a/Modules/CustomRolesHelper.cs b/Modules/CustomRolesHelper.cs index bf136211e..106c35de2 100644 --- a/Modules/CustomRolesHelper.cs +++ b/Modules/CustomRolesHelper.cs @@ -1764,6 +1764,12 @@ internal static class CustomRolesHelper { return role.ColoredTextByRole(Translator.GetString(role.ToString())); } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ColoredTextByRole(string str) + { + return Utils.ColorString(Utils.GetRoleColor(role), str); + } } extension(Team team) @@ -1795,12 +1801,6 @@ internal static class CustomRolesHelper } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string ColoredTextByRole(this CustomRoles role, string str) - { - return Utils.ColorString(Utils.GetRoleColor(role), str); - } - extension(RoleOptionType type) { public Color GetRoleOptionTypeColor() diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 9c482f0b8..bdaed9935 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -497,9 +497,10 @@ internal static class ExtendedPlayerControl LateTask.New(() => player.SetKillCooldown(), 0.2f, log: false); if (Options.AnonymousBodies.GetBool() && Main.AllPlayerNames.TryGetValue(player.PlayerId, out string name)) - RpcChangeSkin(player, new NetworkedPlayerInfo.PlayerOutfit().Set(name, 15, "", "", "", "", ""), sender); - - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) Camouflage.RpcSetSkin(player, sender: sender); + RpcChangeSkin(player, new NetworkedPlayerInfo.PlayerOutfit().Set(name, 15, "", "", "", "", "")); + else + Camouflage.RpcSetSkin(player); + sender.SyncSettings(player); sender.SendMessage(); @@ -2387,9 +2388,81 @@ internal static class ExtendedPlayerControl if (player.IsModdedClient() || player.IsTrusted() || player.FriendCode.GetDevUser().HasTag()) return false; return !Main.GamesPlayed.TryGetValue(player.FriendCode, out int gamesPlayed) || gamesPlayed < 4; } + + public void RpcChangePet(string petId) + { + if (player.Data.DefaultOutfit.PetId == petId) return; + + player.Data.DefaultOutfit.PetId = petId; + player.SyncOutfitData(); + } + + public void RpcChangeColor(byte colorId) + { + if (player.Data.DefaultOutfit.ColorId == colorId) return; + + player.Data.DefaultOutfit.ColorId = colorId; + player.SyncOutfitData(); + } + + public bool RpcChangeOutfitByData(NetworkedPlayerInfo.PlayerOutfit outfit, MessageWriter writer = null, SendOption sendOption = SendOption.Reliable, bool revertShapeshiftIfAlreadyShifted = true) + { + if (!AmongUsClient.Instance.AmHost) return false; + if (player.Is(CustomRoles.BananaMan)) outfit = BananaMan.GetOutfit(Main.AllPlayerNames.GetValueOrDefault(player.PlayerId, "Banana")); + if (outfit.Compare(player.Data.DefaultOutfit)) return false; + Camouflage.SetPetForOutfitIfNecessary(outfit); + if (outfit.Compare(player.Data.DefaultOutfit)) return false; + + player.Data.Outfits[PlayerOutfitType.Default] = outfit; + player.SyncOutfitData(writer, sendOption, revertShapeshiftIfAlreadyShifted); + return true; + } + + public void SyncOutfitData(MessageWriter writer = null, SendOption sendOption = SendOption.Reliable, bool revertShapeshiftIfAlreadyShifted = true) + { + try { player.Shapeshift(player, false); } catch { } + + MessageWriter stream; + + if (writer == null) + { + stream = MessageWriter.Get(sendOption); + stream.StartMessage(5); + stream.Write(AmongUsClient.Instance.GameId); + } + else + { + stream = writer; + } + + stream.StartMessage(1); + stream.WritePacked(player.Data.NetId); + player.Data.Serialize(stream, false); + stream.EndMessage(); + + if (revertShapeshiftIfAlreadyShifted || !player.IsShifted()) + { + stream.StartMessage(2); + stream.WritePacked(player.NetId); + stream.Write((byte)RpcCalls.Shapeshift); + stream.WriteNetObject(player); + stream.Write(false); + stream.EndMessage(); + } + + if (writer == null) + { + stream.EndMessage(); + DataFlagRateLimiter.Enqueue(() => + { + AmongUsClient.Instance.SendOrDisconnect(stream); + stream.Recycle(); + }, channel: sendOption, cleanup: stream.Recycle); + } + } } - // If you use vanilla RpcSetRole, it will block further SetRole calls until the next game starts. + // If you use vanilla RpcSetRole, it will block further SetRole calls until the next game starts. Use RpcSetRoleGlobal! /* public static void RpcShowScanAnimationDesync(this PlayerControl target, PlayerControl seer, bool on) diff --git a/Modules/Extensions/CollectionExtensions.cs b/Modules/Extensions/CollectionExtensions.cs index ae018117e..1a5890885 100644 --- a/Modules/Extensions/CollectionExtensions.cs +++ b/Modules/Extensions/CollectionExtensions.cs @@ -452,7 +452,7 @@ public static class CollectionExtensions public static void NotifyPlayers(this IEnumerable players, string text, float time = 6f, bool overrideAll = false, bool log = true, bool setName = true) { - var sender = CustomRpcSender.Create("NotifyPlayers", SendOption.Reliable); + var sender = CustomRpcSender.Create("NotifyPlayers", SendOption.Reliable).StartPackedMessage(); var hasValue = false; foreach (PlayerControl player in players) @@ -465,7 +465,7 @@ public static class CollectionExtensions } public static void NotifyPlayers(this List players, string text, float time = 6f, bool overrideAll = false, bool log = true, bool setName = true) { - var sender = CustomRpcSender.Create("NotifyPlayers", SendOption.Reliable); + var sender = CustomRpcSender.Create("NotifyPlayers", SendOption.Reliable).StartPackedMessage(); var hasValue = false; for (int index = 0; index < players.Count; index++) diff --git a/Modules/PetsHelper.cs b/Modules/PetsHelper.cs index d061a8417..002c02c9d 100644 --- a/Modules/PetsHelper.cs +++ b/Modules/PetsHelper.cs @@ -12,10 +12,15 @@ public static class PetsHelper SetPet(pc, petId); } - public static void SetPet(PlayerControl pc, string petId, CustomRpcSender writer = null) + public static void SetPet(PlayerControl pc, string petId) { - if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return; - var sender = writer ?? CustomRpcSender.Create("PetsHelper.SetPet", SendOption.Reliable); + if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) + { + pc.RpcChangePet(petId); + return; + } + + var sender = CustomRpcSender.Create("PetsHelper.SetPet", SendOption.Reliable); try { pc.SetPet(petId); } catch { } @@ -27,8 +32,6 @@ public static class PetsHelper .Write(petId) .Write(pc.GetNextRpcSequenceId(RpcCalls.SetPetStr)) .EndRpc(); - - if (writer != null) return; sender.SendMessage(); } diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 3119e9c4b..9a47af091 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -3789,7 +3789,10 @@ public static class Utils public static bool RpcChangeSkin(PlayerControl pc, NetworkedPlayerInfo.PlayerOutfit newOutfit, CustomRpcSender writer = null, SendOption sendOption = SendOption.Reliable) { - if (!AmongUsClient.Instance.AmHost || GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return false; + if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) + return pc.RpcChangeOutfitByData(newOutfit, writer?.stream, sendOption); + + if (!AmongUsClient.Instance.AmHost) return false; if (pc.Is(CustomRoles.BananaMan)) newOutfit = BananaMan.GetOutfit(Main.AllPlayerNames.GetValueOrDefault(pc.PlayerId, "Banana")); @@ -4221,7 +4224,7 @@ public static class Utils { LateTask.New(() => { - if (GameStates.IsEnded || GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return; + if (GameStates.IsEnded) return; string petId = PetsHelper.GetPetId(); PetsHelper.SetPet(pc, petId); pc.Data.DefaultOutfit.PetSequenceId += 10; diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs index 2b7b3e0f0..912d9240b 100644 --- a/Patches/ChatCommandPatch.cs +++ b/Patches/ChatCommandPatch.cs @@ -1557,7 +1557,7 @@ internal static class ChatCommands { return role switch { - CustomRoles.Camouflager or CustomRoles.Magistrate or CustomRoles.Devourer or CustomRoles.Venerer or CustomRoles.Amogus or CustomRoles.Shadow or CustomRoles.MoonDancer or CustomRoles.Merchant or CustomRoles.Catalyst or CustomRoles.Doppelganger or CustomRoles.Butcher when GameStates.CurrentServerType == GameStates.ServerType.Vanilla => true, + CustomRoles.Butcher when GameStates.CurrentServerType == GameStates.ServerType.Vanilla => true, CustomRoles.Ventriloquist when GameStates.CurrentServerType == GameStates.ServerType.Vanilla => true, CustomRoles.Weatherman when Main.LIMap || GameStates.CurrentServerType == GameStates.ServerType.Vanilla => true, CustomRoles.RoomRusher when Main.LIMap => true, diff --git a/Patches/CheckGameEndPatch.cs b/Patches/CheckGameEndPatch.cs index c6844d6ba..688b3f603 100644 --- a/Patches/CheckGameEndPatch.cs +++ b/Patches/CheckGameEndPatch.cs @@ -84,9 +84,8 @@ internal static class GameEndChecker Ended = true; LoadingEndScreen = true; - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) - foreach (var pc in Main.CachedAllPlayerControls()) - Camouflage.RpcSetSkin(pc, true, true, true); + foreach (var pc in Main.CachedAllPlayerControls()) + Camouflage.RpcSetSkin(pc, true, true, true); NameNotifyManager.Reset(); NotifyRoles(ForceLoop: true); diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 757ecc626..c1f9e2b3e 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -1266,51 +1266,58 @@ internal static class IntroCutsceneDestroyPatch { void GrantPetForEveryone() { - if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return; - CustomRpcSender sender = CustomRpcSender.Create(nameof(GrantPetForEveryone), SendOption.Reliable); + var messages = 0; + var stream = MessageWriter.Get(SendOption.Reliable); + stream.StartMessage(5); + stream.Write(AmongUsClient.Instance.GameId); foreach (PlayerControl pc in aapc) { - if (pc.Is(CustomRoles.GM)) continue; + try + { + if (pc.Is(CustomRoles.GM)) continue; - string petId = PetsHelper.GetPetId(); - PetsHelper.SetPet(pc, petId, sender); - Logger.Info($"{pc.GetNameWithRole()} => {GetString(petId)} Pet", "PetAssign"); + if (stream.Length > 500 || messages + 2 > AmongUsClient.Instance.GetMaxMessagePackingLimit()) + { + stream.EndMessage(); + + var captured = stream; + DataFlagRateLimiter.Enqueue(() => + { + AmongUsClient.Instance.SendOrDisconnect(captured); + captured.Recycle(); + }, cleanup: captured.Recycle); + + stream = MessageWriter.Get(SendOption.Reliable); + stream.StartMessage(5); + stream.Write(AmongUsClient.Instance.GameId); + + messages = 0; + } + + string petId = PetsHelper.GetPetId(); + pc.Data.DefaultOutfit.PetId = petId; + pc.SyncOutfitData(stream); + messages += 2; + Logger.Info($"{pc.GetNameWithRole()} => {GetString(petId)} Pet", "PetAssign"); + } + catch (Exception e) { Utils.ThrowException(e); } } - sender.SendMessage(); + stream.EndMessage(); + DataFlagRateLimiter.Enqueue(() => + { + AmongUsClient.Instance.SendOrDisconnect(stream); + stream.Recycle(); + }, cleanup: stream.Recycle); } LateTask.New(GrantPetForEveryone, 3f, "Grant Pet For Everyone"); LateTask.New(() => { - lp.Notify(GetString("GLHF"), 2f); - - bool hasValue = false; - var sender = CustomRpcSender.Create("Shapeshift After Pet Assign On Game Start", SendOption.Reliable); - sender.StartPackedMessage(); - - foreach (PlayerControl pc in aapc) - { - if (pc.AmOwner || pc.OwnerId < 0) continue; // Skip the host - - try - { - sender.AutoStartRpc(pc.NetId, 46, pc.OwnerId); - sender.WriteNetObject(pc); - sender.Write(false); - sender.EndRpc(); - - sender.Notify(pc, GetString("GLHF"), 2f); - - hasValue = true; - } - catch (Exception ex) { Logger.Fatal(ex.ToString(), "IntroPatch.RpcShapeshift"); } - } - - sender.SendMessage(dispose: !hasValue); - }, 4f, "Show Pet For Everyone"); + aapc.NotifyPlayers(GetString("GLHF"), 3f); + }, 4f, "GLHF"); } if (Options.RandomSpawn.GetBool() && Main.CurrentMap != MapNames.Airship && !Main.LIMap && AmongUsClient.Instance.AmHost && Options.CurrentGameMode is not CustomGameMode.CaptureTheFlag and not CustomGameMode.KingOfTheZones and not CustomGameMode.BedWars and not CustomGameMode.Deathrace) diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 6f30371c0..63d8af95b 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -895,8 +895,7 @@ internal static class ShapeshiftPatch if (!shapeshifting) { - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) - Camouflage.RpcSetSkin(shapeshifter); + Camouflage.RpcSetSkin(shapeshifter); } else { @@ -1414,7 +1413,7 @@ internal static class ReportDeadBodyPatch { try { - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla && Main.CheckShapeshift.ContainsKey(pc.PlayerId) && !Doppelganger.DoppelVictim.ContainsKey(pc.PlayerId)) + if (Main.CheckShapeshift.ContainsKey(pc.PlayerId) && !Doppelganger.DoppelVictim.ContainsKey(pc.PlayerId)) Camouflage.RpcSetSkin(pc, revertToDefault: true); if (Main.CurrentMap == MapNames.Fungle && (pc.IsMushroomMixupActive() || IsActive(SystemTypes.MushroomMixupSabotage))) diff --git a/Roles/Standard/Crewmate/Miscellaneous/Tar.cs b/Roles/Standard/Crewmate/Miscellaneous/Tar.cs index 476c09d98..04c481060 100644 --- a/Roles/Standard/Crewmate/Miscellaneous/Tar.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Tar.cs @@ -52,7 +52,7 @@ public class Tar : RoleBase Main.AllPlayerSpeed[pc.PlayerId] = Main.MinSpeed; Main.PlayerStates[pc.PlayerId].IsBlackOut = true; - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor(6); + pc.RpcChangeColor(6); pc.MarkDirtySettings(); Timer = new CountdownTimer(AbilityDuration.GetFloat(), () => @@ -61,7 +61,7 @@ public class Tar : RoleBase if (!pc || !pc.IsAlive()) return; Main.AllPlayerSpeed[pc.PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod); Main.PlayerStates[pc.PlayerId].IsBlackOut = false; - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor((byte)ColorId); + pc.RpcChangeColor((byte)ColorId); pc.MarkDirtySettings(); }, cancelOnMeeting: false, onCanceled: () => { @@ -93,7 +93,7 @@ public class Tar : RoleBase Timer = null; Main.AllPlayerSpeed[TarId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod); Main.PlayerStates[TarId].IsBlackOut = false; - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) TarId.GetPlayer()?.RpcSetColor((byte)ColorId); + TarId.GetPlayer()?.RpcChangeColor((byte)ColorId); } } } \ No newline at end of file diff --git a/Roles/Standard/Crewmate/Power/Astral.cs b/Roles/Standard/Crewmate/Power/Astral.cs index f73688456..0f8860416 100644 --- a/Roles/Standard/Crewmate/Power/Astral.cs +++ b/Roles/Standard/Crewmate/Power/Astral.cs @@ -86,7 +86,7 @@ public class Astral : RoleBase GhostRolesManager.RemoveGhostRole(pc.PlayerId); ReportDeadBodyPatch.AlreadyReportedBodies.Remove(pc.PlayerId); pc.RpcSetRoleGlobal(Options.UsePets.GetBool() ? RoleTypes.Crewmate : RoleTypes.Engineer); - if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) Camouflage.RpcSetSkin(pc); + Camouflage.RpcSetSkin(pc); if (onMeeting) return;