mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Kill server on quit
As suggested by Ryozuki
This commit is contained in:
parent
3983bfeeef
commit
46b21020be
|
@ -354,6 +354,7 @@ public:
|
|||
void RenderUpdating(const char *pCaption, int current=0, int total=0);
|
||||
|
||||
bool IsActive() const { return m_MenuActive; }
|
||||
void KillServer();
|
||||
|
||||
virtual void OnInit();
|
||||
|
||||
|
|
|
@ -107,8 +107,7 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
{
|
||||
if(m_ServerProcess.Process)
|
||||
{
|
||||
kill_process(m_ServerProcess.Process);
|
||||
m_ServerProcess.Process = 0;
|
||||
KillServer();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -252,3 +251,12 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
m_ShowStart = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CMenus::KillServer()
|
||||
{
|
||||
if(m_ServerProcess.Process)
|
||||
{
|
||||
kill_process(m_ServerProcess.Process);
|
||||
m_ServerProcess.Process = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -883,6 +883,7 @@ void CGameClient::OnStateChange(int NewState, int OldState)
|
|||
|
||||
void CGameClient::OnShutdown()
|
||||
{
|
||||
m_pMenus->KillServer();
|
||||
m_pRaceDemo->OnReset();
|
||||
m_pGhost->OnReset();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue