mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix OnPlayerChatEvent not being raised when map has level-only chat.
This commit is contained in:
parent
8643ca1434
commit
7abd3196e3
@ -471,19 +471,17 @@ namespace MCGalaxy {
|
|||||||
text = HandleJoker(text);
|
text = HandleJoker(text);
|
||||||
if (Chatroom != null) { Chat.MessageChatRoom(this, text, true, Chatroom); return; }
|
if (Chatroom != null) { Chat.MessageChatRoom(this, text, true, Chatroom); return; }
|
||||||
|
|
||||||
if (!level.Config.ServerWideChat) {
|
bool levelOnly = !level.SeesServerWideChat;
|
||||||
Logger.Log(LogType.PlayerChat, "<{0}>[level] {1}", name, text);
|
string format = levelOnly ? "<{0}>[level] {1}" : "<{0}> {1}";
|
||||||
|
Logger.Log(LogType.PlayerChat, format, name, text);
|
||||||
|
|
||||||
|
OnPlayerChatEvent.Call(this, text);
|
||||||
|
if (cancelchat) { cancelchat = false; return; }
|
||||||
|
|
||||||
|
if (levelOnly) {
|
||||||
Chat.MessageLevel(this, text, true, level);
|
Chat.MessageLevel(this, text, true, level);
|
||||||
} else {
|
} else {
|
||||||
Logger.Log(LogType.PlayerChat, "<{0}> {1}", name, text);
|
SendChatFrom(this, text);
|
||||||
OnPlayerChatEvent.Call(this, text);
|
|
||||||
if (cancelchat) { cancelchat = false; return; }
|
|
||||||
|
|
||||||
if (ServerConfig.ServerWideChat) {
|
|
||||||
SendChatFrom(this, text);
|
|
||||||
} else {
|
|
||||||
Chat.MessageLevel(this, text, true, level);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
CheckForMessageSpam();
|
CheckForMessageSpam();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user