summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-13 23:02:10 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-13 23:02:10 +0200
commita49c004278b0e300521e9cedf44a46ac843a958b (patch)
treecc268ccbd5b938be93923d9aced847572364e263 /source/Player.cpp
parentFixed a bit of coding style and function names in cItem (diff)
downloadcuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar.gz
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar.bz2
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar.lz
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar.xz
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.tar.zst
cuberite-a49c004278b0e300521e9cedf44a46ac843a958b.zip
Diffstat (limited to '')
-rw-r--r--source/Player.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index af2e00570..cfbf5cdff 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -99,7 +99,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
cPlayer::~cPlayer(void)
{
- LOG("Deleting cPlayer \"%s\" at %p, ID %d; inv win %p", m_PlayerName.c_str(), this, GetUniqueID(), m_InventoryWindow);
+ LOG("Deleting cPlayer \"%s\" at %p, ID %d", m_PlayerName.c_str(), this, GetUniqueID());
SaveToDisk();
@@ -109,7 +109,7 @@ cPlayer::~cPlayer(void)
delete m_InventoryWindow;
- LOG("Player %p deleted", this);
+ LOGD("Player %p deleted", this);
}
@@ -119,7 +119,7 @@ cPlayer::~cPlayer(void)
void cPlayer::Initialize( cWorld* a_World )
{
cPawn::Initialize( a_World );
- GetWorld()->AddPlayer( this );
+ GetWorld()->AddPlayer(this);
}
@@ -156,7 +156,7 @@ void cPlayer::SpawnOn(cClientHandle & a_Client)
-void cPlayer::Tick(float a_Dt, MTRand & a_TickRandom)
+void cPlayer::Tick(float a_Dt, cChunk & a_Chunk)
{
if (!m_ClientHandle->IsPlaying())
{
@@ -164,7 +164,7 @@ void cPlayer::Tick(float a_Dt, MTRand & a_TickRandom)
return;
}
- super::Tick(a_Dt, a_TickRandom);
+ super::Tick(a_Dt, a_Chunk);
//TODO: Change this to use the BroadcastMovementUpdate function
if (m_bDirtyOrientation && !m_bDirtyPosition)
{
@@ -853,12 +853,11 @@ bool cPlayer::MoveToWorld( const char* a_WorldName )
/* Remove all links to the old world */
m_World->RemovePlayer( this );
m_ClientHandle->RemoveFromAllChunks();
- m_World->RemoveEntityFromChunk(this, m_ChunkX, m_ChunkY, m_ChunkZ);
+ m_World->RemoveEntityFromChunk(this, GetChunkX(), GetChunkZ());
/* Add player to all the necessary parts of the new world */
SetWorld( World );
- GetWorld()->AddPlayer( this );
- MoveToCorrectChunk(true);
+ GetWorld()->AddPlayer(this);
GetClientHandle()->StreamChunks();
return true;