summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-12 08:35:13 +0200
committermadmaxoft <github@xoft.cz>2013-08-12 08:35:13 +0200
commitc628ab03e9aae0b8e56f260ad02cfc7d51285a71 (patch)
tree402ee387cbf33bd6ca39f718f7addb4fdcc82dd2 /source/ClientHandle.cpp
parentRemoved unused cServer::IsConnected() function. (diff)
downloadcuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.gz
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.bz2
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.lz
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.xz
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.zst
cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.zip
Diffstat (limited to 'source/ClientHandle.cpp')
-rw-r--r--source/ClientHandle.cpp14
1 files changed, 8 insertions, 6 deletions
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();