summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-10-21 20:59:48 +0200
committerMattes D <github@xoft.cz>2015-10-21 20:59:48 +0200
commitda92286da9f3a3022d4641c29f6e5ecd9986f30b (patch)
tree2fc6299cb6b43d745244c10ab62942e5760d56a7 /src/ClientHandle.cpp
parentMerge pull request #2517 from cuberite/ReTypingOfBlocks (diff)
downloadcuberite-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.cpp13
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);
}