diff options
author | Mattes D <github@xoft.cz> | 2015-10-21 20:59:48 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-10-21 20:59:48 +0200 |
commit | da92286da9f3a3022d4641c29f6e5ecd9986f30b (patch) | |
tree | 2fc6299cb6b43d745244c10ab62942e5760d56a7 /src/ClientHandle.cpp | |
parent | Merge pull request #2517 from cuberite/ReTypingOfBlocks (diff) | |
download | cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar.gz cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar.bz2 cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar.lz cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar.xz cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.tar.zst cuberite-da92286da9f3a3022d4641c29f6e5ecd9986f30b.zip |
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index bc7df883a..d3e30fc9c 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2097,7 +2097,18 @@ void cClientHandle::SendChat(const AString & a_Message, eMessageType a_ChatPrefi void cClientHandle::SendChat(const cCompositeChat & a_Message) { - m_Protocol->SendChat(a_Message, ctChatBox, GetPlayer()->GetWorld()->ShouldUseChatPrefixes()); + cWorld * World = GetPlayer()->GetWorld(); + if (World == nullptr) + { + World = cRoot::Get()->GetWorld(GetPlayer()->GetLoadedWorldName()); + if (World == nullptr) + { + World = cRoot::Get()->GetDefaultWorld(); + } + } + + bool ShouldUsePrefixes = World->ShouldUseChatPrefixes(); + m_Protocol->SendChat(a_Message, ctChatBox, ShouldUsePrefixes); } |