summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);
}