summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-01 22:38:20 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-01 22:38:20 +0100
commit4cebaa99f88e25e039416354cf490fe98642af7e (patch)
tree40f8b0cc061e3ec55539e30754df3e3d1c17dd80 /source/Player.cpp
parentAdded Bats and Witches. (diff)
downloadcuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar.gz
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar.bz2
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar.lz
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar.xz
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.tar.zst
cuberite-4cebaa99f88e25e039416354cf490fe98642af7e.zip
Diffstat (limited to 'source/Player.cpp')
-rw-r--r--source/Player.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index 708eca9f4..cf9e4be99 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -79,8 +79,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
cTimer t1;
m_LastPlayerListTime = t1.GetNowTime();
- m_TimeLastTeleportPacket = cWorld::GetTime();
- m_TimeLastPickupCheck = cWorld::GetTime();
+ m_TimeLastTeleportPacket = 0;
+ m_TimeLastPickupCheck = 0;
m_PlayerName = a_PlayerName;
m_bDirtyPosition = true; // So chunks are streamed to player at spawn
@@ -189,12 +189,12 @@ void cPlayer::Tick(float a_Dt)
float SqrDist = DiffX * DiffX + DiffY * DiffY + DiffZ * DiffZ;
if (
(SqrDist > 4 * 4) || // 4 blocks is max Relative Move
- (cWorld::GetTime() - m_TimeLastTeleportPacket > 2 ) // Send an absolute position every 2 seconds
+ (m_World->GetWorldAge() - m_TimeLastTeleportPacket > 40) // Send an absolute position every 2 seconds
)
{
// LOG("Teleported %f", sqrtf(SqrDist) );
m_World->BroadcastTeleportEntity(*this, m_ClientHandle);
- m_TimeLastTeleportPacket = cWorld::GetTime();
+ m_TimeLastTeleportPacket = m_World->GetWorldAge();
}
else
{
@@ -474,7 +474,7 @@ void cPlayer::SetLastBlockActionTime()
{
if (m_World != NULL)
{
- m_LastBlockActionTime = m_World->GetTime();
+ m_LastBlockActionTime = m_World->GetWorldAge() / 20.0f;
}
}