mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2460
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:
commit
d7a0a914c3
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue