From 53c31ee1cdbfd0cd6c30ddaeac480ccbcb12f21a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 3 Nov 2013 11:57:43 +0100 Subject: ClientHandle: Fixed an error in player-joining hook. Players being disconnected used to fire the PlayerJoined hook repeatedly. --- source/ClientHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/ClientHandle.cpp') diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp index ea8b48f9d..6860a29ca 100644 --- a/source/ClientHandle.cpp +++ b/source/ClientHandle.cpp @@ -1470,7 +1470,7 @@ void cClientHandle::Tick(float a_Dt) } // If the chunk the player's in was just sent, spawn the player: - if (m_HasSentPlayerChunk && (m_State != csPlaying)) + if (m_HasSentPlayerChunk && (m_State != csPlaying) && !IsDestroying()) { if (!cRoot::Get()->GetPluginManager()->CallHookPlayerJoined(*m_Player)) { @@ -2138,7 +2138,7 @@ void cClientHandle::PacketUnknown(unsigned char a_PacketType) LOGERROR("Unknown packet type 0x%02x from client \"%s\" @ %s", a_PacketType, m_Username.c_str(), m_IPString.c_str()); AString Reason; - Printf(Reason, "[C->S] Unknown PacketID: 0x%02x", a_PacketType); + Printf(Reason, "Unknown [C->S] PacketType: 0x%02x", a_PacketType); SendDisconnect(Reason); Destroy(); } -- cgit v1.2.3