Fixed a crash when sending messages too early after connection.
This commit is contained in:
parent
140d31343f
commit
da92286da9
@ -2097,7 +2097,18 @@ void cClientHandle::SendChat(const AString & a_Message, eMessageType a_ChatPrefi
|
|||||||
|
|
||||||
void cClientHandle::SendChat(const cCompositeChat & a_Message)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user