From f4a1ebd88000b62706aaa08fc21db5d0e65354f6 Mon Sep 17 00:00:00 2001 From: mathiascode <8754153+mathiascode@users.noreply.github.com> Date: Tue, 3 Apr 2018 16:39:39 +0300 Subject: Properly destroy player (#4199) --- src/ClientHandle.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 3afd4cc83..e28391fca 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2048,13 +2048,6 @@ void cClientHandle::Tick(float a_Dt) ProcessProtocolInOut(); - m_TicksSinceLastPacket += 1; - if (m_TicksSinceLastPacket > 600) // 30 seconds time-out - { - SendDisconnect("Nooooo!! You timed out! D: Come back!"); - return; - } - // If player has been kicked, terminate the connection: if (m_State == csKicked) { @@ -2071,6 +2064,13 @@ void cClientHandle::Tick(float a_Dt) return; } + m_TicksSinceLastPacket += 1; + if (m_TicksSinceLastPacket > 600) // 30 seconds time-out + { + SendDisconnect("Nooooo!! You timed out! D: Come back!"); + return; + } + // Only process further if the player object is valid: if (m_Player == nullptr) { -- cgit v1.2.3