From edd4c8ca88717cb18fcace1de17afb21e9f9c9b2 Mon Sep 17 00:00:00 2001 From: dragon <52032586+eternalcomet@users.noreply.github.com> Date: Thu, 11 Aug 2022 13:50:08 +0800 Subject: [PATCH] fix:command player said to server won't be shown at chat history (#1643) Original commits: * fix:command player said to server won't be shown at chat history * Update ChatManager.java --- .../grasscutter/game/managers/chat/ChatManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/managers/chat/ChatManager.java b/src/main/java/emu/grasscutter/game/managers/chat/ChatManager.java index 3bf46e03a..e295ae514 100644 --- a/src/main/java/emu/grasscutter/game/managers/chat/ChatManager.java +++ b/src/main/java/emu/grasscutter/game/managers/chat/ChatManager.java @@ -136,11 +136,6 @@ public class ChatManager implements ChatManagerHandler { // Get target. Player target = getServer().getPlayerByUid(targetUid); - // Check if command - if (tryInvokeCommand(player, target, message)) { - return; - } - if (target == null && targetUid != GameConstants.SERVER_CONSOLE_UID) { return; } @@ -152,7 +147,10 @@ public class ChatManager implements ChatManagerHandler { player.sendPacket(packet); putInHistory(player.getUid(), targetUid, packet.getChatInfo()); - if (target != null) { + // Check if command + boolean isCommand = tryInvokeCommand(player, target, message); + + if ((target != null) && (!isCommand)) { target.sendPacket(packet); putInHistory(targetUid, player.getUid(), packet.getChatInfo()); }