Skip to content

Commit 82fdfd6

Browse files
committed
Fix "text container was not empty" crash caused by chatbubbles
1 parent ca27f30 commit 82fdfd6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/game/client/components/entity/chat_bubbles.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void CChatBubbles::RemoveBubble(int ClientId, CBubble Bubble)
139139
if(*it == Bubble)
140140
{
141141
TextRender()->DeleteTextContainer(it->m_TextContainerIndex);
142+
it->m_TextContainerIndex.Reset();
142143
m_avChatBubbles[ClientId].erase(it);
143144
UpdateBubbleOffsets(ClientId);
144145
return;
@@ -304,17 +305,14 @@ void CChatBubbles::OnRender()
304305

305306
void CChatBubbles::Reset()
306307
{
307-
if(m_avChatBubbles->empty())
308-
return;
309-
310308
for(int ClientId = 0; ClientId < MAX_CLIENTS; ++ClientId)
311309
{
312310
for(auto &Bubble : m_avChatBubbles[ClientId])
313311
{
314312
if(Bubble.m_TextContainerIndex.Valid())
315313
{
316314
TextRender()->DeleteTextContainer(Bubble.m_TextContainerIndex);
317-
Bubble.m_TextContainerIndex = STextContainerIndex();
315+
Bubble.m_TextContainerIndex.Reset();
318316
}
319317
Bubble.m_Cursor.m_FontSize = 0;
320318
}
@@ -350,7 +348,7 @@ void CChatBubbles::SetupTextcontainer(CBubble &Bubble)
350348
if(Bubble.m_TextContainerIndex.Valid())
351349
{
352350
TextRender()->DeleteTextContainer(Bubble.m_TextContainerIndex);
353-
Bubble.m_TextContainerIndex = STextContainerIndex();
351+
Bubble.m_TextContainerIndex.Reset();
354352
}
355353

356354
CTextCursor Cursor;

0 commit comments

Comments
 (0)