1
0

Fixed a crash when sending messages too early after connection.

This commit is contained in:
Mattes D 2015-10-21 20:59:48 +02:00
parent 140d31343f
commit da92286da9

View File

@ -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);
}