Skip to content

Commit

Permalink
システムメッセージも名前が被らないように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tanakanira0118 committed Oct 25, 2022
1 parent e88849b commit f6a75fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Patches/ChatCommandPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ public static void Postfix(ChatController __instance)
if (player == null) return;
(string msg, byte sendTo) = Main.MessagesToSend[0];
Main.MessagesToSend.RemoveAt(0);
int return_count = player.name.Count(x => x == '\n');
msg = new StringBuilder(msg).Insert(0, "\n", return_count).ToString();
int clientId = sendTo == byte.MaxValue ? -1 : Utils.GetPlayerById(sendTo).GetClientId();
if (clientId == -1) DestroyableSingleton<HudManager>.Instance.Chat.AddChat(player, msg);
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)RpcCalls.SendChat, SendOption.None, clientId);
Expand Down

0 comments on commit f6a75fa

Please sign in to comment.