2460: Don't reset chat on map change (fixes #2451) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-07-09 18:38:40 +00:00 committed by GitHub
commit d7a0a914c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -35,7 +35,7 @@ CChat::CChat()
#include <game/server/ddracechat.h>
m_Commands.sort_range();
OnReset();
Reset();
}
void CChat::RegisterCommand(const char *pName, const char *pParams, int flags, const char *pHelp)
@ -53,7 +53,7 @@ void CChat::OnWindowResize()
}
}
void CChat::OnReset()
void CChat::Reset()
{
for(int i = 0; i < MAX_LINES; i++)
{
@ -80,6 +80,8 @@ void CChat::OnReset()
m_pHistoryEntry = 0x0;
m_PendingChatCounter = 0;
m_LastChatSend = 0;
m_CurrentLine = 0;
m_Mode = MODE_NONE;
for(int i = 0; i < CHAT_NUM; ++i)
m_aLastSoundPlayed[i] = 0;
@ -94,13 +96,8 @@ void CChat::OnStateChange(int NewState, int OldState)
{
if(OldState <= IClient::STATE_CONNECTING)
{
m_Mode = MODE_NONE;
Reset();
Input()->SetIMEState(false);
for(int i = 0; i < MAX_LINES; i++)
{
m_aLines[i].m_Time = 0;
}
m_CurrentLine = 0;
}
}

View file

@ -92,6 +92,7 @@ class CChat : public CComponent
bool LineShouldHighlight(const char *pLine, const char *pName);
void StoreSave(const char *pText);
void Reset();
public:
CChat();
@ -105,7 +106,6 @@ public:
void Echo(const char *pString);
virtual void OnWindowResize();
virtual void OnReset();
virtual void OnConsoleInit();
virtual void OnStateChange(int NewState, int OldState);
virtual void OnRender();