From c628ab03e9aae0b8e56f260ad02cfc7d51285a71 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 12 Aug 2013 08:35:13 +0200 Subject: Removed cServer::BroadcastChat() and cServer::SendMessage(). These two functions make it difficult to move to the new ticking system, and they aren't used anyway. If so required, they can be emulated by ForEachWorld / ForEachPlayer calls. --- source/ClientHandle.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/ClientHandle.cpp') diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp index 14b052652..54e191281 100644 --- a/source/ClientHandle.cpp +++ b/source/ClientHandle.cpp @@ -1355,12 +1355,14 @@ void cClientHandle::Tick(float a_Dt) m_ShouldCheckDownloaded = false; } + if (m_Player == NULL) + { + return; + } + // Send a ping packet: cTimer t1; - if ( - (m_Player != NULL) && // Is logged in? - (m_LastPingTime + cClientHandle::PING_TIME_MS <= t1.GetNowTime()) - ) + if ((m_LastPingTime + cClientHandle::PING_TIME_MS <= t1.GetNowTime())) { m_PingID++; m_PingStartTime = t1.GetNowTime(); @@ -1369,7 +1371,7 @@ void cClientHandle::Tick(float a_Dt) } // Handle block break animation: - if ((m_Player != NULL) && (m_BlockDigAnimStage > -1)) + if (m_BlockDigAnimStage > -1) { int lastAnimVal = m_BlockDigAnimStage; m_BlockDigAnimStage += (int)(m_BlockDigAnimSpeed * a_Dt); @@ -1955,7 +1957,7 @@ void cClientHandle::SendConfirmPosition(void) if (!cRoot::Get()->GetPluginManager()->CallHookPlayerJoined(*m_Player)) { // Broadcast that this player has joined the game! Yay~ - cRoot::Get()->GetServer()->BroadcastChat(m_Username + " joined the game!", this); + m_Player->GetWorld()->BroadcastChat(m_Username + " joined the game!", this); } SendPlayerMoveLook(); -- cgit v1.2.3