From 6c3e2713deb227c10767c54eee8554fdf368ad03 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 1 Dec 2018 14:24:00 +0100 Subject: [PATCH] fixed server crash --- src/game/server/gamecontext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 0da93ff1b..2f9c00c7c 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -681,8 +681,6 @@ void CGameContext::OnClientDrop(int ClientID, const char *pReason) { AbortVoteOnDisconnect(ClientID); m_pController->OnPlayerDisconnect(m_apPlayers[ClientID]); - delete m_apPlayers[ClientID]; - m_apPlayers[ClientID] = 0; // update clients on drop if(Server()->ClientIngame(ClientID)) @@ -704,6 +702,9 @@ void CGameContext::OnClientDrop(int ClientID, const char *pReason) Server()->SendPackMsg(&Msg, MSGFLAG_VITAL|MSGFLAG_NORECORD, -1); } + delete m_apPlayers[ClientID]; + m_apPlayers[ClientID] = 0; + m_VoteUpdate = true; }